We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

Assignment Operator (=)

Assigns a value to a variable.

result = expression


Any variable.


Any expression.

The = operator returns the value of expression and assigns that value into variable. This means that you can chain assignment operators as follows:

j = k = l = 0;

j, k, and l equal zero after the example statement is executed.

The data type of expression must be coercible to the data type of result.