I want to check the value of a variable that I set inside the main function, but the if statement is not inside a function. Here is what I have so far.
bool condition;
#if(condition)
:
:
:
some code
#endif
int main(int argc, char *argv[])
{
condition = processArgs(argc, argv);
}
From my understanding macros are executed during compilation time and not run time. Is there another way to check the value of the variable condition outside functions. The value of the variable condition is set depending on the command line arguments passed by the user. So how do I use if statements outside the scope of functions? Because macro if does not work.
Aucun commentaire:
Enregistrer un commentaire