Is size_t only in C++ standard or C standard as well?
I cannot find a C header in the "/usr/include" tree that defines size_t.
If it is not in the C std, is GCC just doing some magic to make things work?
Thanks, Chenz
Is size_t only in C++ standard or C standard as well?
I cannot find a C header in the "/usr/include" tree that defines size_t.
If it is not in the C std, is GCC just doing some magic to make things work?
Thanks, Chenz
size_t is from the C standard library
It is declared in
#include <stddef.h> //For C
#include <cstddef> //For C++
From C99 draft:
7.17 Common definitions <stddef.h>
The following types and macros are defined in the standard header <stddef.h>
. Some
are also defined in other headers, as noted in their respective subclauses.
The types are [-snip-]
size_t
which is the unsigned integer type of the result of the sizeof
operator; [-snip-]