When to use `short` over `int`?
问题 There are many questions that asks for difference between the short and int integer types in C++, but practically, when do you choose short over int ? 回答1: (See Eric's answer for more detailed explanation) Notes: Generally, int is set to the 'natural size' - the integer form that the hardware handles most efficiently When using short in an array or in arithmetic operations, the short integer is converted into int , and so this can introduce a hit on the speed in processing short integers