469,919 Members | 2,189 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,919 developers. It's quick & easy.

How to replace: #if VAR1 == 100 ... #elif VAR2 = 1 ... #endif, With #ifdef VAR1 ... ? ... #endif

Hello,

Is there anyway to do it other than using :
#ifdef VAR1

...
#endif
#ifdef VAR2
...
#endif
Thank you,
Christopher Lusardi
Jul 22 '05 #1
1 2142
"Christopher M. Lusardi" <cl********@aol.com> wrote...
Hello,

Is there anyway to do it other than using :
#ifdef VAR1

...
#endif
#ifdef VAR2
...
#endif

I am honestly not sure what you want, but

#ifdef blah

is equivalent to

#if defined(blah)

so you could write

#if defined(VAR1)
...
#elif defined(VAR2)
...
#endif

Of course, it's not going to work if you really need to branch
depending on the _value_ of VAR1...

V
Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Targa | last post: by
7 posts views Thread by malli | last post: by
2 posts views Thread by Charles Sullivan | last post: by
19 posts views Thread by Hrvoje Voda | last post: by
2 posts views Thread by John Doe | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.