mercredi 24 février 2021

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

Aucun commentaire:

Enregistrer un commentaire