简单赋值 (C)Simple Assignment (C)

简单赋值运算符可将其右操作数赋给其左操作数。The simple-assignment operator assigns its right operand to its left operand. 右操作数的值将转换为赋值表达式的类型,并替换存储在左侧操作数指定的对象中的值。The value of the right operand is converted to the type of the assignment expression and replaces the value stored in the object designated by the left operand. 用于赋值的转换规则适用(请参阅赋值转换)。The conversion rules for assignment apply (see Assignment Conversions).

double x;  
int y;  

x = y;  

在此示例中,将 y 的值转换为类型 double 并赋给 xIn this example, the value of y is converted to type double and assigned to x.

另请参阅See Also

C 赋值运算符C Assignment Operators