fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main () {
  6.  
  7. //Works
  8. cout << "Hello World\n";
  9.  
  10. //Works
  11. char c[] = "Hello World\n";
  12. cout << c;
  13.  
  14. //Crashes on cout
  15. int i = 2;
  16. cout << i;
  17.  
  18. //Crashes on the string declaration
  19. string str = "Hello World\n";
  20. cout << str;
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
Hello World
Hello World
2Hello World