Where do I find the definition of size_t? Where do I find the definition of size_t? c c

Where do I find the definition of size_t?


From Wikipedia

The stdlib.h and stddef.h header files define a datatype called size_t1 which is used to represent the size of an object. Library functions that take sizes expect them to be of type size_t, and the sizeof operator evaluates to size_t.

The actual type of size_t is platform-dependent; a common mistake is to assume size_t is the same as unsigned int, which can lead to programming errors,2 particularly as 64-bit architectures become more prevalent.

From C99 7.17.1/2

The following types and macros are defined in the standard header stddef.h

<snip>

size_t

which is the unsigned integer type of the result of the sizeof operator


According to size_t description on en.cppreference.com size_t is defined in the following headers :

std::size_t...    Defined in header <cstddef>         Defined in header <cstdio>      Defined in header <cstring>         Defined in header <ctime>       Defined in header <cwchar>


size_t is the unsigned integer type of the result of the sizeof operator (ISO C99 Section 7.17.)

The sizeof operator yields the size (in bytes) of its operand, which may be anexpression or the parenthesized name of a type. The size is determined from the type ofthe operand. The result is an integer. The value of the result is implementation-deļ¬ned, and its type (an unsigned integer type) is size_t (ISO C99 Section 6.5.3.4.)