By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,371 Members | 1,495 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,371 IT Pros & Developers. It's quick & easy.

Macro question

P: n/a
Hi,

is correct a macro construction like these ones?

#define DEBUG_FLAGS 0x84
[.. Some code below...]
#if DEBUG_LVL && 0x80
[...]
#endif
And these (equivalent) ones too?

#define DEBUG_FLAGS 0x84
[.. Some code below...]
#if (DEBUG_LVL % 0x80) == 0
[...]
#endif
Thank you.

--
Saludos,
Alejandro Torras.

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Alejandro Torras <at************@IThotmail.com> writes:
is correct a macro construction like these ones?

#define DEBUG_FLAGS 0x84
Fine so far.
[.. Some code below...]
#if DEBUG_LVL && 0x80


1. What's DEBUG_LVL? If it is not defined, then it will be
treated as 0, and the following code will not be included.

2. 0x80 is always non-zero, so this would normally be equivalent
to just "#if DEBUG_LVL".

In conclusion, it's valid, but confusing.
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.