M
Michael
int& mmin(const int &a, const int &b)
{
int c=a+b;
return c;
}
---------------
I got confused... variable c is initialized in the function "mmin". It
should be on the stack. After the function is done, the storage of "c"
should be gone too...
That does the "int &" do as a reference to a non-existing variable?
Suprisingly, it worked with no problem...
Anybody can explain?
{
int c=a+b;
return c;
}
---------------
I got confused... variable c is initialized in the function "mmin". It
should be on the stack. After the function is done, the storage of "c"
should be gone too...
That does the "int &" do as a reference to a non-existing variable?
Suprisingly, it worked with no problem...
Anybody can explain?