What is size_t in C?

前端 未结 13 1720
礼貌的吻别
礼貌的吻别 2020-11-22 05:00

I am getting confused with size_t in C. I know that it is returned by the sizeof operator. But what exactly is it? Is it a data type?

Let\'

13条回答
  •  长发绾君心
    2020-11-22 05:16

    From my understanding, size_t is an unsigned integer whose bit size is large enough to hold a pointer of the native architecture.

    So:

    sizeof(size_t) >= sizeof(void*)
    

提交回复
热议问题