问个关于sizeof的问题
在msdn中,查到
4.2.1 Integral Types and Values
The values of the integral types are integers in the following ranges:
For byte, from -128 to 127, inclusive
For short, from -32768 to 32767, inclusive
For int, from -2147483648 to 2147483647, inclusive
For long, from -9223372036854775808 to 9223372036854775807, inclusive
For char, from '\u0000' to '\uffff' inclusive, that is, from 0 to 65535
sizeof(byte)结果为1
sizeof(char)结果为1
sizeof(int)结果为4
sizeof(long)结果为4
sizeof(float)结果为4
sizeof(double)结果为8
sizeof(long double)结果为8
还有
char p1[]="I am"
char p2[]={'I','','a','m'}
sizeof(p1)结果为5
sizeof(p2)结果为4
谁能解释下。