问题描述
标准是什么意思:
for(long i = 0; i< 0; ++ i);
for(myclass i = 0; i< 0; ++ i);
是允许的吗?我只是在for-loop空间中定义,不是吗?
VC6给我一个*错误*,而不仅仅是一个愚蠢的警告。
-
-Gernot
int main(int argc,char ** argv){printf
("%silto%c%cf%cgl% ssic%ccom%c"," ma",58,''g'',64," ba",46,10);}
________________________________________
正在寻找一款好游戏?亲自动手吧!
GLBasic - 你可以这样做
What does the standart say:
for (long i=0; i<0; ++i) ;
for (myclass i=0; i<0; ++i);
is it allowed? i only is defined in the for-loop space, isn''t it?
VC6 gives me an *error*, not just a stupid warning.
--
-Gernot
int main(int argc, char** argv) {printf
("%silto%c%cf%cgl%ssic%ccom%c", "ma", 58, ''g'', 64, "ba", 46, 10);}
________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com
推荐答案
标准说好了。
VC ++ 6的最佳解决方案是
#define for if(0);否则为每个源文件顶部的
。这有效地将每个for循环放在其自身范围内。
John
Standard says its OK.
The best solution on VC++ 6 is
#define for if (0); else for
at the top of every source file. This effectively puts each for loop inside
its own scope.
John
yuck!这会给出任何问题吗?我现在看不到任何东西。我将
包括在我的afx.h中用于VC6。谢谢。
-Gernot
yuck! will this give any problems? I can''t see any right now. I''ll
include this in my afx.h for VC6. Thank you.
-Gernot
哎呀!这会给出任何问题吗?我现在看不到任何东西。我会在我的afx.h中为VC6包含这个。谢谢。
-Gernot
yuck! will this give any problems? I can''t see any right now. I''ll
include this in my afx.h for VC6. Thank you.
-Gernot
标准认为#define关键字是非法的。但是我在VC ++ 6上广泛使用了这个
,它从来没有给我带来任何问题。
john
Standard says its illegal to #define a keyword. However I''ve used this
extensively on VC++ 6 and its never caused any problems for me.
john
这篇关于重新定义,不同类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!