SponsoredAmazon Best Sellers in Video GamesUpdated hourly by Amazon.Shop best sellers
Sponsored · Popular on AmazonTools & Home ImprovementPet SuppliesPatio, Lawn & GardenArts, Crafts & Sewing
As an Amazon Associate I earn from qualifying purchases.

Topic summary

Sizeof

sizeof is a unary operator in the C and C++ programming languages that evaluates to the storage size of an expression or a data type, measured in units sized as char. Consequently, the expression sizeof(char) evaluates to 1. The number of bits of type char is specified by the preprocessor macroCHAR_BIT, defined in the standard include file<limits.h>. On most modern computing platforms this is eight bits. The result of sizeof is an unsigned integer that is usually typed as size_t.

The operator accepts a single operand which is either a data type expressed as a cast – the name of a data type enclosed in parentheses – or a non-type expression for which parentheses are not required.