Advertisement
Jambix64

UsingVactorUpdate1

Sep 4th, 2016
466
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4.  
  5. using namespace std;
  6.  
  7. namespace variavel1{
  8.  int tm;
  9.  
  10. }
  11.  // Use scope resolution operator
  12.  namespace variavel2 {
  13.  
  14.      int receive1, receive2, receive3;
  15.  
  16. }
  17.  
  18. int main(){
  19.     using namespace variavel1;
  20.  
  21.     vector <int> v(3);
  22.     variavel2::receive1 = v[0] = 100;
  23.     variavel2::receive2 = v[1] = 200;
  24.     variavel2::receive3 = v[2] = 600;
  25.  
  26.     variavel1::tm = v.size();
  27.  
  28.     for (int i = 0; i <variavel1::tm; i++) {
  29.  
  30.         cout << v[i] << endl;
  31.     }
  32.  
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement