This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/60959] New: Does âcout<<(char*)NULLâ doing âclose(1)â ?
- From: "sree.gooogle at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 25 Apr 2014 02:44:37 +0000
- Subject: [Bug c++/60959] New: Does âcout<<(char*)NULLâ doing âclose(1)â ?
- Auto-submitted: auto-generated
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!