Thread: Need opinion...
View Single Post
Old Jan 25th, 2005, 9:44 PM   #48
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
Global variables are generally declared before main. Their scope lasts throughout the entire program. You can assign them a value when you declare them, or later on in the program, it doesn't really matter.

Couple of things on the side:

1.) You would probably get more replies if you created individual threads in the appropriate forum with your questions. Honestly, I don't check introduction threads once I've said hi more than once or twice. I could almost assure you that the help you recieve will be 10 times better in the C/C++ forum in various threads than you're going to get hear. If you'd like, I can split this thread for you so the C/C++ oriented questions are in the proper forum and make a thread or two (as needed) for your various questions.

2.) From what I've learned, global variables are conventionally to be avoided.
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower

Last edited by Mjordan2nd; Jan 25th, 2005 at 9:55 PM.
Mjordan2nd is offline   Reply With Quote