char c[] = {'a','b','c'};
int* p = &c[0];
printf("%i
", sizeof(*p)); //Prints out 4
printf("%i
", sizeof(*c)); //Prints out 1
I am extremely confused about this section of code. Both p and c represent the address of the array c at the 0th index. But why does sizeof(*p) print out 4? Shouldn't it be 1?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…