(**I am sorry for the spelling mistake in the title**)
What's the syntax for initializing a global variable with a number in a data file?
I only know how to change the value of a variable from a data file using an ifstream variable and the >> operator. However I can't (or don't know how to) use the >> operator outside of the main function.
For instance, if the name of the data name is info.dat and it has only one number - 100 in it. How would you initialize a global variable, say it is called a, from info.dat, the data file?