Friday, September 9, 2011

namespace

#include <iostream>

using namespace std;


namespace myspace {
int x;
string s;
}

namespace myspace2 {
string s2;
}

using namespace myspace2;

int main()
{
myspace::x = 5;
myspace::s = "Hello!";
cout << myspace::s << endl;

s2 = "Hello 2";
cout << s2 << endl;

return 0;
}



namespace

No comments:

Post a Comment