Is there any way to evaluate expressions in the case of an array. If the expression E has the form E1 [E2], where E1 and E2 are also expressions, is the evaluation order of E1 and E2 fixed?
Here is my code:
#include<stdio.h>
int main(){
int a[5] = {1,2,3,4,5};
(a + printf("1"))[printf("2")];
(printf("3"))[a + printf("4")];
return 0;
}
It shows the result as: 1 243
I'v compiled it with gcc.
Thank.
source
share