sizeof (int) 说明 sizeof 不是一个函数,函数不接受int做为形参。
MSDN的说明如下:
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.
本文详细解释了C/C++中sizeof操作符的功能与用法。它返回变量或类型的存储大小(以字节为单位),适用于变量、类型乃至静态数组。文中还提到了sizeof不能用于动态分配数组或外部数组。
1072

被折叠的 条评论
为什么被折叠?



