fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main(){
  4. const char* str;
  5. str = "\0"; // or str = 0;
  6. cout << str << endl;
  7. cerr << "str points to: " << (int)str << endl;
  8. cerr << cout.bad() << endl;
  9. cerr << cout.eof() << endl;
  10. cerr << cout.fail() << endl;
  11. cout << "Welcome" << endl;
  12. return 0;
  13. }
Success #stdin #stdout 0.01s 2724KB
stdin
Standard input is empty
stdout
Welcome