Yes. Variables declared outside of main() (and any other function) are global and are allocated in the data segment. Variables declared within main() are allocated on the stack as in any other function. The space is released when main() terminates - which is when the program terminates.
Alan
|