fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. std::string str(NULL);
  7. cout << '{' << str << '}' << endl;
  8. return 0;
  9. }
Runtime error #stdin #stdout #stderr 0s 3468KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct null not valid