sizeof
is a C keyword. It returns the size in a type named size_t
. However, size_t
is not a keyword, but is defined primarily in stddef.h
and probably other C standard header files too.
Consider a scenario where you want to create a C program which does not include any C standard headers or libraries. (Like for example, if you are creating an OS kernel.) Now, in such code, sizeof
can be used (it is a C keyword, so it is a part of the language), but the type that it returns (size_t
) is not available!
Does not this signify some kind of a problem in the C standard specification? Can you clarify this?