int a = 3, b = 5;
int c = a * b + ++b; //是先++b呢还是先a * b?
cout << c << endl;
不同编译器产生不同结果;
改进后:
c = b + a * b;
b++;
//or
b++;
c = b + a * b;
int a = 3, b = 5;
int c = a * b + ++b; //是先++b呢还是先a * b?
cout << c << endl;
不同编译器产生不同结果;
改进后:
c = b + a * b;
b++;
//or
b++;
c = b + a * b;