C: Why isn't size_t a C keyword?

前端 未结 10 2010
鱼传尺愫
鱼传尺愫 2020-12-28 14:18

sizeof is a C keyword. It returns the size in a type named size_t. However, size_t is not a keyword, but is

10条回答
  •  无人及你
    2020-12-28 15:02

    Some headers from the C standard are defined for a freestanding environment, i.e. fit for use e.g. in an operating system kernel. They do not define any functions, merely defines and typedefs.

    They are float.h, iso646.h, limits.h, stdarg.h, stdbool.h, stddef.h and stdint.h.

    When working on an operating system, it isn't a bad idea to start with these headers. Having them available makes many things easier in your kernel. Especially stdint.h will become handy (uint32_t et al.).

提交回复
热议问题