Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <algorithm>
- using namespace std;
- namespace variavel1{
- int tm;
- }
- // Use scope resolution operator
- namespace variavel2 {
- int receive1, receive2, receive3;
- }
- int main(){
- using namespace variavel1;
- vector <int> v(3);
- variavel2::receive1 = v[0] = 100;
- variavel2::receive2 = v[1] = 200;
- variavel2::receive3 = v[2] = 600;
- // prtIT aponta para o primeiro elemento
- // vector <int>::iterator prtIT = v.begin();
- vector <int>::iterator ptrIT;
- for (ptrIT=v.begin(); ptrIT != v.end(); ptrIT++) {
- cout << *ptrIT << endl;
- }
- // Saida foi
- //100
- //200
- //600
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement