fork(4) download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. string a;
  6.  
  7. namespace myNamespace
  8. {
  9. string a;
  10. void output()
  11. {
  12. cout << ::a << endl;
  13. }
  14. }
  15.  
  16. int main()
  17. {
  18. a = "Namespaces, meh.";
  19. myNamespace::a = "Namespaces are great!";
  20. myNamespace::output();
  21. }
Success #stdin #stdout 0.02s 2856KB
stdin
Standard input is empty
stdout
Namespaces, meh.