In the following 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? What is actually happening here? Is this a bug? Please share your thoughts.
#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??
}
I have tried this with both gcc and DevCpp compilers, same behavior observed.