This is what i have coded today
#include <iostream>
using namespace std;
int function1()
{
cout<<"hello from function1()"; return 0;
}
int function2()
{
cout<<"hello from function2()"; return 0;
}
int main()
{
int func_diffresult = 0;
func_diffresult = function1() - function2();
cout<<func_diffresult; /** prints 0 correctly **/
}
the output is get is hello from function2()hello from function1()
. I think the output should be hello from function1()hello from function2()
. Is my compiler playing with me?
The order of evaluation of arguments of
-
operator is unspecified. So functions may be called in either order.