I’m working on C++,
The following is a function call in C++,
argument = myFunction(argument);
What will be the value of argument variable passed to myFunction() call i.e. value assigned before call to the function or value returned from the myFunction() function call.
Due to temporal necessity, the value of
argumentbefore callingmyFunctionwill be passed. This is simply because you don’t have the return value yet.The parameters to a function call have to be evaluated before the call. The order of evaluation between parameters is unspecified, but you only have one, so it is evaluated. Whatever it is at that point (before the call) is used, then the function is called. When the function returns, after being run, the return value is assigned to
argument.