fork download
  1. include <iostream>
  2. using namespace std;
  3. namespace {
  4. int Troll = 1;
  5. float Wizard = -0.5;
  6. }
  7. namespace Mordor {
  8. int Troll = 2 ;
  9. float Wizard = 0.5;
  10. }
  11. int main(void) {
  12. cout << Troll << " " << Wizard << endl;
  13. cout << Mordor::Troll << " " << Mordor::Wizard << endl;
  14. return 0;
  15. }
Compilation error #stdin compilation error #stdout 0s 4416KB
stdin
Standard input is empty
compilation info
prog.cpp:1:1: error: ‘include’ does not name a type
 include <iostream>
 ^~~~~~~
prog.cpp: In function ‘int main()’:
prog.cpp:12:2: error: ‘cout’ was not declared in this scope
  cout << Troll << " " << Wizard << endl;
  ^~~~
prog.cpp:12:36: error: ‘endl’ was not declared in this scope
  cout << Troll << " " << Wizard << endl;
                                    ^~~~
stdout
Standard output is empty