fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. class Console {
  5. static void WriteLine(string txt) {
  6. std::cout << txt;
  7. }
  8. };
  9.  
  10.  
  11. namespace Program {
  12. class Start {
  13. static void Main(string args[]) {
  14. Console.WriteLine("Hello\n");
  15. }
  16. };
  17. }
  18.  
  19.  
  20. int main() {
  21. Program::Start.Main();
  22. return 0;
  23. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:5:24: error: ‘string’ has not been declared
  static void WriteLine(string txt) {
                        ^~~~~~
prog.cpp:13:20: error: ‘string’ has not been declared
   static void Main(string args[]) {
                    ^~~~~~
prog.cpp: In static member function ‘static void Program::Start::Main(int*)’:
prog.cpp:14:11: error: expected unqualified-id before ‘.’ token
    Console.WriteLine("Hello\n");
           ^
prog.cpp: In function ‘int main()’:
prog.cpp:21:16: error: expected unqualified-id before ‘.’ token
  Program::Start.Main();
                ^
stdout
Standard output is empty