Hello,
I have a problem with declaring a variable which can be used in functions.
Let's say I want to do something like this:
1 2 3 4 5 6 7 8 9 10
int G_NUMBER; //a global variable (being initialized with 0)
int main()
{
int number;
cin >> number;
G_NUMBER = number; // ERROR - how to change G_NUMBER value?
return 0;
}
I want to use the same value of G_NUMBER as a CONST value in a lot of functions, but I can't use #DEFINE for this because this value is from input.
How can I do it so other functions will see this value which was from input?
Thanks!