http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60959
Bug ID: 60959 Summary: Does “cout<<(char*)NULL” doing “close(1)” ? Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: sree.gooogle at gmail dot com In the following piece of C++ code I have used cout<<(char*)NULL; after this line, my program printing nothing to the output screen. Does it mean I have done close(1) with cout here? #include<iostream> using namespace std; void f(){ cout<<"\nfun\n"; } main(){ cout<<(char*)NULL; f(); //not getting printed ! cout<<"\nhello\n"; //not getting printed ! cout<<"hii how are you?"; //not getting printed, why?? } compiled using: g++ myprog.cpp run: ./a.out o/p: Prints nothing I have tried this code in gcc as well as DevCpp compiler, same behavior observed. Is this a compiler bug? Please provide detailed information about this behavior. Thank you!