Using assignment statements
STL variables represent storage locations in computer memory. The
data in one of these storage locations can be modified by assigning
it a new value. An assignment names a variable and gives it a value.
In STL, assignments are specified by an equal sign (=). An assignment
statement uses the following syntax:
variable_name = expression
For
example, you might make the following assignment: message = 'Take care!'
This
means that the string 'Take care!' is to be put into the location
called "message" in the computer's memory.If the type of the variable has been declared before the assignment is processed, the type of the variable must be the same as the type of the expression. If the variable type has not been declared, it will be implicitly declared as having the same type as the expression and a class of UNSHARED.
For information about what can be contained in an expression, see Using expressions.