| sizeof | Keyword

Keyword Index

Returns the size of the expression or type.

Keyword `sizeof` is, in fact, an operator. It returns the size, in bytes, of the given expression or type (as type size_t). Its argument may be an expression of a type name:

    sizeof expression
    sizeof (type)

For example,

    workspace = calloc (100, sizeof (int));
    memset(buff, 0, sizeof buff);
    nitems = sizeof (table) / sizeof (table[0]);

Note that type may be an anonymous type (see asterisk for more info about anonymous types).