Suppose I hae to following:
int &f() {
static int x = 0;
return x;
}
void main() { f() = 5; }
I realize that this function returns a reference to an integer (I have tried to use this Function returning int&).
Does it mean that x will be equal to 5 in this case?
I do not really realize what f() = 5
in that...
In addition, what change could it make If would omit 'static' above?. I know that static int is an integer which exist actually before the program exists, but I am not sure it helps me to understand what change would happen.
I am trying to find out the answers for that with using debugger.