再次给微软跪了,求GCCER帮忙跑一段代码
c++吧
全部回复
仅看楼主
level 10
#include <iostream>
using namespace std;
int main()
{
cout<<__FILE__<<endl;
cout<<__LINE___<<endl; //error C2065: “__LINE___”: 未声明的标识符
cout<<__DATE___<<endl; //error C2065: “__DATE___”: 未声明的标识符
cout<<__TIME__<<endl;
return 0;
}
上面的代码其中的两行 VS2008 报错了,求问在GCC上以上代码是否可以运行?
2012年11月20日 11点11分 1
level 10
primer书上的代码都报错,说好的兼容ANSI标准呢[拍砖]
2012年11月20日 11点11分 2
level 8
这一般不都是定义宏吗
2012年11月20日 11点11分 3
是啊,FILE和TIME可用,但是LINE和DATE在VS2008中用会报错[拍砖]
2012年11月20日 11点11分
缺少相关文件?或作用域问题?
2012年11月20日 11点11分
level 12
那些东东是什么?要我是编译器我也会给你报错,,,
2012年11月20日 11点11分 5
level 10
貌似三横... [汗]
2012年11月20日 11点11分 6
level 10
#define __LINE___ __LINE__
#define
__DATE___ __DATE__
保证LZ能过 [汗]
2012年11月20日 11点11分 7
[拍砖]过了,尼玛写成了左边两横右边三横了
2012年11月20日 12点11分
level 12
2012年11月20日 12点11分 8
1