Why the C++ compiler does not give precedence (increment operator under assignment) in this simple program?
问题 According to the table of precedence of operators in C/C++ language (see Wikipedia), the increment operator (++) takes precedence with respect to the assignment operator (=). Can someone explain why the compiler first assign the value (1 in bill[x]) and then increases the index value (i++) in this simple program. I think it should be the opposite (first increase and then assign): #include <iostream> using namespace std; int bill[] = {16, 17, 18, 19, 20}; int main () { int i = 3; bill[(i++)] =