Is there a order which is followed when passing argument to a function in c++? or is it compiler dependent?
I am unable to understand the output what is happening here?!
#include <iostream>
void sum(int a, int b){
std::cout << "a = " << a << " " << "b = " << b << '\n';
std::cout << "sum = " << a+b;
}
int main(){
int a=1;
sum(++a, a++);
return 0;
}
Output:
a = 3
b = 1
sum = 4
Regards