I'm a starter at c++ and tonight I started working with functions and somehow I can't understand how this function works, exactly how the return x works because when I debug the program the results is y=4 and I don't know how it is calcuted.
thanks a lot to anyone who replies...
Post a Reply
|Oldest Newest Rating|
· January 25, 2015
Like what Krootushas Gesu said,
because you are returning x not the y.
y = a + b;
return x; // x = 2
So, the result is 4
Used in many types of software including music players, video games, and many large scale applications.
|Bucky Roberts Administrator|