I am writing a main functions, with MACRO and global variables,
Please don't do that. You are building a disaster model. I got to work on a systme like this one time. There were 380 programs and all of the variables were global. Every function has no arguments. Because of that, the ability to change the system went to zero since you would have to review every function in every program every time for every change.
To avoid this, programmers just added new global variables to avoid trouble by changing the existing ones.
There is no reason for a global variable:
1) local variable hides global variable of the same name
2) name conflicts. even within namespaces.
3) exposes implementation. No redesign
4) causes race conditions in multithreaded programs
5) expands ripple when value is screwed up. every function is a suspect
6) no guarantee the user will use global
7) expands program footprint
8) memory for globals may be limited
9) no guarantee for the order of creation. Only the globals in a single file are crerated in the order of declaration. The total order is indeterminate. Hence, your global may no be there when you need it. Especially if a global object needs a global variable in another file in its constructor. aka: the initialization fiasco
10) expands ripple when a recode is needed. All the code using globals has to be changed. N=Bad if there is a large installed base.