2021-02-25

How do I use the #if directive

#define String1 1
#define String2 3

#if X == String1
#   include "String1.h"
#elif X == String2
#   include "String2.h"
#else
//no header file to include

#endif

my question is the "X" variable (macro) in #if X... Is X local to this file and is it looking for the macros String1 or String2 to be non 0 value I am a little fuzzy on pre-compiler directives



from Recent Questions - Stack Overflow https://ift.tt/3uvRsnR
https://ift.tt/eA8V8J

No comments:

Post a Comment