本文共 313 字,大约阅读时间需要 1 分钟。
先来看一个C++程序(.cpp):
#include居然得出了100的结果, 吓我一跳。int fun(int x){ return x * x;}int a = fun(10);int main(){ printf("a = %d\n", a); return 0;}
再看C程序(.c):
#include编译错误, 符合我的预期。int fun(int x){ return x * x;}int a = fun(10);int main(){ printf("a = %d\n", a); return 0;}
上述编译器都是VC++6.0. 有兴趣的读者可以深究一下。
转载地址:http://txrvi.baihongyu.com/