首先看一MSDN上如何对sizeof进行定义的:
sizeof Operator
sizeof expression
The sizeof keyword gives the amount of storage, in bytes, associated with a variable or a type
(including aggregate types). This keyword returns a value of type size_t.
The expression is either an identifier or a type-cast expression (a type specifier enclosed in
parentheses).
When applied to a structure type or variable, sizeof returns the actual size, which may include
padding bytes inserted for alignment. When applied to a statically dimensioned array, sizeof
returns the size of the entire array. The sizeof operator cannot return the size of dynamically
allocated arrays or external arrays.
sizeof()是运算符而不是函数,它只认括号里面变量,结构体等的类型的整体大小(具体用法可参看7#).而不在里面进行运算.所以你sizeof(i);sizeof(++i);sizeof(--i)的结果都是一样的.