First off, you have some syntax errors in your program.
Line 6 - missing << between "" and prod.
Line 9 - extraneous " at end of line
Line 21, 22 - Missing ;
After correcting the syntax errors, the program runs as follows:
10 15 - Before first call
10 15 - First display inside testOne
30 45 - After multiplication
10 45 - After return. num (1st arg) unchanged. prod (2nd arg) changed.
45 10 - First display inside testone shows arguments reversed.
20 30 - After multiplication
30 45 - After second call. prod (1st arg) unchanged. num (2nd arg) changed.
I'm just confused as to why the switch occurs there without displaying 10 45 again before the switch |
Why would it? There is only one display where the numbers are 10,45 and that is after returning from testOne the first time.
PLEASE USE CODE TAGS (the <> formatting button) when posting code.
http://v2.cplusplus.com/articles/jEywvCM9/
It makes it easier to read your code and it also makes it easier to respond to your post.