开发者

Strange preprocessing

Something strange happens.

I have in my code in a local function

#ifdef abc
.
.
.
#endif

when I write on the top of the file

开发者_StackOverflow
#define abc

it acts as if it isn't defined. only when I define

#define abc

in the local function itself it reads the code in the ifdef.

This is strange because I thought that the compiler just goes over the whole file without details of functions to change the # preprocessing orders. can't understand what's happening. I am using visual-studio 2005.


Probably you had the #define before #include "stdafx.h". This is ignored.


I think you run the sample in release mode.so some block of code is not able to execute in release mode.what you made copy the line and paste somewhere so that it works.

The previous answer is not the right one.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜