函数调用转换Function-Call Conversions

对函数调用中的自变量执行的转换的类型取决于是否存在具有调用的函数的声明自变量类型的函数原型(前向声明)。The type of conversion performed on the arguments in a function call depends on the presence of a function prototype (forward declaration) with declared argument types for the called function.

如果函数原型存在并包含声明的参数类型,编译器将执行类型检查(请参阅函数)。If a function prototype is present and includes declared argument types, the compiler performs type checking (see Functions).

如果函数原型不存在,则只对函数调用中的自变量执行常用算术转换。If no function prototype is present, only the usual arithmetic conversions are performed on the arguments in the function call. 这些转换独立于调用中的每个自变量执行。These conversions are performed independently on each argument in the call. 这意味着 float 值被转换为 double; char 或 short 值被转换为 int;并且 unsigned char 或 unsigned short 被转换为 unsigned intThis means that a float value is converted to a double; a char or short value is converted to an int; and an unsigned char or unsigned short is converted to an unsigned int.

另请参阅See Also

类型转换Type Conversions