then it prompts error saying that the "base" is not defined in func1.
so I'm puzzled. if the function which uses base is above main() in the same file main.cpp ( main() is where the variable is defiend), then the variable is not defined. then why functions in separate files could use the variable?
BTW, if I should not use global variables, then what should I do?