Text in a function printed before it is called
Dear All
I have two C City & Guilds (4240, 4250) and I have decided to continue and learn C++. So I have purchased a book with compiler on CD, Bloodshed Dev-C++. I have written a programme found in the book and the output is as the book describes. However, I do not understand it. I read on to see if the book explined my question but it did not. See if you can.
Code:
#include <iostream>
int Add (int x, int y)
{
std:: cout << "In Add(), received " << x << " and " << y << "\n";
return (x+y);
}
int main()
{
std:: cout << "The value returned is : " << Add(3,4);
return 0;
}
Code:
Output to screen
In Add(), received 3 and 4
The value returned is : 7
And the problem:
Why does the text in the function get printed to screen before
the function is called?