Operators: Assignment Operators
Applies To: C++Builder 1 or higher
Category: C++ Language
- The C++ assignment operator is the single equal sign:
-
- variable = expression;
-
- It is important to notice that x = y; does not mean x is equal to y. It only assigns the value of the variable y to the variable x. You can also use multiple assignments on the same line:
-
- x = y = z = 5;
-
- You can also combine the binary mathematical operators with the equal sign. For example, x *= 2; is the same as x = x * 2; The combination of mathematical operators with assignment operators is called compound assignment.
C++Builder Developer's Network
Copyright © Yoto Yotov