【发布时间】:2014-06-10 13:57:47
【问题描述】:
在下面的代码中,我在这一行之后使用了cout<<(char*)NULL;,我的程序在输出屏幕上没有打印任何内容。这是否意味着我在这里完成了close(1) 和cout?这里实际发生了什么?这是一个错误吗?请分享您的想法。
#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??
}
我在 gcc 和 DevCpp 编译器上都试过了,观察到的行为相同。
【问题讨论】: