i have a very simple c program
the output is 2, but if i change the printf statement toCode:int main() { int i; int four_int[4]; char* c; for (i=0; i<4; i++) four_int[i]=2; c = (char*)four_int; for (i=0; i<4; i++) c[i]=1; printf("%x\n", four_int[2]); return 0; }
the output is 1010101. Can anyone tell me why this happen? Thanks!!Code:printf("%x\n", four_int[0]);