Is the max value of size_t (SIZE_MAX) defined relative to the other integer types?

后端 未结 3 409
执念已碎
执念已碎 2021-02-04 08:48

I\'m writing a library of functions that will safely convert between various numeric types or die trying. My intent is roughly equal parts create-useful-library and learn-C-edge

3条回答
  •  -上瘾入骨i
    2021-02-04 09:03

    I agree with Remo.D's interpretation.

    size_t is specified to be a standard unsigned integer, but the standard does not restrict its size relative to any of them other than by saying that it must be able to hold at least 65535.

    It can therefor be smaller, equal, or larger in size than unsigned int.

提交回复
热议问题