分配运算符
赋值运算符 =
将左手操作数的值设置为右手操作数的值,并返回该值:
int a = 3; // assigns value 3 to variable a
int b = a = 5; // first assigns value 5 to variable a, then does the same for variable b
Console.WriteLine(a = 3 + 4); // prints 7
赋值运算符 =
将左手操作数的值设置为右手操作数的值,并返回该值:
int a = 3; // assigns value 3 to variable a
int b = a = 5; // first assigns value 5 to variable a, then does the same for variable b
Console.WriteLine(a = 3 + 4); // prints 7