fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. int main()
  5. {
  6. std::string* s = "hello";
  7. std::cout << "ok" << std::endl;
  8. std::cout << s->c_str() << std::endl;
  9. return 0;
  10. }
  11.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:6: error: cannot convert ‘const char*’ to ‘std::string*’ in initialization
stdout
Standard output is empty