Sizeof
In the programming languages C and C++, the unary operator sizeof
is used to calculate the size of any datatype, measured in the number of bytes required to represent the type. A byte in this context is the same as an unsigned char, and may be larger than 8 bits, although that is uncommon. The result of sizeof
is the size of the type of the expression or parenthesized type-specifier that it precedes, and has an unsigned integral type which is usually denoted by size_t
. sizeof
can be applied to any datatype, including primitive types such as integer and floating-point types, pointer types, or compound datatypes (unions, structs, or C++ classes).
Read more about Sizeof.
Related Subjects
Related Phrases
Related Words