sizeof operator

sizeof operator

Queries size of the object or type.

Used when actual size of the object must be known.

Syntax

sizeof( type ) (1)
sizeof expression (2)

Both versions return a constant of type std::size_t.

Explanation

1) Returns size in bytes of the object representation of type.