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;
- /*Para acessar o primeiro e o ultimo elemento do vector*/
- cout << *v.begin() << endl;
- // Precisa decrementar
- cout << *(--v.end()) << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement