Assignment Expression
Previous Topic  Next Topic 

assignment_expression is any expression where a variable or array is assigned a value.   It also included assignments that combine the assignment with an arithmetic expression (+=, *= etc).    The full list of assignment expressions is as follows:


identifier = expr

* identifier = expr

identifier [expr] = expr

identifier += expr

identifier -= expr

identifier *= expr

identifier /= expr



For example:


a=5*5;    // assign variable a to 25

*b=34;    // assign contents of variable pointed to by b to 34

c+=25;    // equivalent to c=c+25;

d-=34;    // equivalent to d=d-34;

e*=25;    // equivalent to e=e*25

f/=34;    // equivalent to f=f/34;