Why must a short be converted to an int before arithmetic operations in C and C++?
问题 From the answers I got from this question, it appears that C++ inherited this requirement for conversion of short into int when performing arithmetic operations from C. May I pick your brains as to why this was introduced in C in the first place? Why not just do these operations as short ? For example ( taken from dyp's suggestion in the comments ): short s = 1, t = 2 ; auto x = s + t ; x will have type of int . 回答1: If we look at the Rationale for International Standard—Programming Languages