Assignment operator '='
suggest changeThe assignment operator = sets the left-hand operand to the value of the right-hand operand and returns that value:
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
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents