出典:Wikipedia
出典:『Wikipedia』 (2011/05/25 19:17 UTC 版)
In the programming languages C and C++, the unary operator sizeof is used to calculate the sizes of datatypes, in number of bytes. A byte in this context is the same as an unsigned char, and may be larger than the standard 8 bits, although that is relatively uncommon in modern implementations. sizeof returns the size of the type of the variable or parenthesized type-specifier that it precedes as a size_t type value. sizeof can be applied to all datatypes, be they primitive types such as the integer and floating-point types defined in the language, pointers to memory addresses, or the compound datatypes (unions, structs, or C++ classes) defined by the programmer.