<P> In the programming languages C and C++, the unary operator sizeof generates the size of a variable or datatype, measured in the number of char - sized storage units required for the type . Consequently, the construct sizeof (char) is guaranteed to be 1 . The actual number of bits of type char is specified by the preprocessor macro CHAR_BIT, defined in the standard include file limits. h . On most modern systems this is eight bits . The result has an unsigned integral type that is usually denoted by size_t . </P> <P> The operator has a single operand, which is either a variable or a data type cast . A cast is a data type enclosed in parenthesis . Data types may not only be primitive types, such as integer and floating - point types, but also pointer types, and compound datatypes (unions, structs, and C++ classes). </P>

What is the use of sizeof operator in c++