When to use short instead of int?

前端 未结 5 1712
梦如初夏
梦如初夏 2021-02-08 11:46

Two use cases for which I would consider short come to mind:

  1. I want an integer type that\'s at least 16 bits in size
  2. I want an integer type t
5条回答
  •  南旧
    南旧 (楼主)
    2021-02-08 12:04

    ANSI C specifies minimum value ranges for types. You can only be sure of the first case; not the second.

提交回复
热议问题