C: Why isn't size_t a C keyword?

前端 未结 10 2021
鱼传尺愫
鱼传尺愫 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:05

    From MSDN:

    When the sizeof operator is applied to an object of type char, it yields 1

    Even if you don't have stddef.h available/included and don't know about size_t, using sizeof you can get the size of objects relative to char.

提交回复
热议问题