fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. namespace X
  5. {
  6. void func1() { cout << "Hi\n"; }
  7. }
  8.  
  9. namespace Y
  10. {
  11. X::func1;
  12. }
  13.  
  14. int main()
  15. {
  16. X::func1();
  17. Y::func1();
  18. return 0;
  19. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:11: error: expected constructor, destructor, or type conversion before ‘;’ token
prog.cpp: In function ‘int main()’:
prog.cpp:17: error: ‘func1’ is not a member of ‘Y’
stdout
Standard output is empty