I made the following #defines
#define GOLD 1;
#define SILVER 2;
later in my program I set some variables
int source, target;
Then they are set to:
source = GOLD;
target = SILVER;
Now I want to compare in the if statement:
if(source == GOLD) {...}
But the compiler complains about Waiting for ')' before ';' marker. If I changed the line to
if(source == 1) {...}
No problem with compiler or behavior. How can I refer to #define in an if statement so that I can verify the compiler?
source
share