#include <iostream>
usingnamespace std;
namespace Tom {
int var = 10;
}
namespace Jerry {
int var = 1000;
}
int main()
{
cout << "Tom::var = " << Tom::var << endl;
cout << "Jerry::var = " << Jerry::var << endl << endl;
using Tom::var;
cout << "AFTER using Tom::var; --> var = " << var << endl << endl;
usingnamespace Jerry;
cout << "AFTER using namespace Jerry; --> var = " << var << endl << endl;
return 0;
}
Tom::var = 10
Jerry::var = 1000
AFTER using Tom::var; --> var = 10
AFTER using namespace Jerry; --> var = 10
Process returned 0 (0x0) execution time : 0.016 s
Press any key to continue.