Assignment Operator

 




  • A = B : stores the value of B into A;
  • A op= B :applies op to A and B, storing the result in A.


  • A is a modifiable value expression, whose type is not qualified as const;
  • op is any operator that can be used as an assignment operator ; B is an expression;

  • In the first expression, if B is one of the basic data types (except void), it is converted to match the type of A.
  • If A is a pointer, B must be a pointer to the same type as A, a void pointer, or the null pointer.
  • If A is a void pointer, B can be of any pointer type.
  • The second expression is treated as follows;
                          A = A op (B)

Example: 








Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.