tags:

views:

38

answers:

1

I want to define a macro kDependentMacro to be 38 if the macro kIndependentMacro is defined and 40 otherwise. What is the simplest way to do that?

+5  A: 
#ifdef kIndependentMacro
#  define kDependentMacro 38
#else
#  define kDependentMacro 40
#endif
seren23
ugh. I was hoping there was something prettier. Judging by the fact that this already has 4 upvotes, apparently not :(
William Jockusch