Translations of this page?:

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 an object of type std::size_t.

Explanation

1) returns size in bytes of any instance of the given type.

2) returns size in bytes of any instance of the type that would be returned by the given expression if evaluated.

Parameters

type - typename of a type to be examined

expression - an expression to be examined

Return value

size of any instance of the given type or the type of the given expression.

Keywords

See also

 
• • • SitemapRecent changesRSScc