Size_t和int区别

Size_t主要用来计数,如sizeof得到的类型即为size_t。

  • 在32位架构中被普遍定义为:   typedef   unsigned int size_t; (4个字节)
  • 而在64位架构中被定义为:      typedef  unsigned long size_t;(8个字节)
  • 它是无符号数!

 

int 则无论在32位还是64位架构中,都是4个字节!带符号数!

posted on 2018-08-09 17:34  Magic_chao  阅读(1746)  评论(0编辑  收藏  举报

导航