What is the difference between “short int” and “int” in C?

后端 未结 9 2074
闹比i
闹比i 2020-12-24 07:22

How is short int (or short) and int different in C? They have the same size and range. If they are essentially the same, what is the use of having two data types?

9条回答
  •  情歌与酒
    2020-12-24 07:55

    Actually everything depends on compiler and system both. But the basic rule says that int can never be less than short and can never be greater than long.

    short <= int <= long

提交回复
热议问题