Electron microscopy
 
Compound Assignment in DM
- Practical Electron Microscopy and Database -
- An Online Book -
Microanalysis | EM Book                                                                                   http://www.globalsino.com/EM/        


=================================================================================

 

DM based on C++ has a special shorthand called compound assignment that combines an assignment with another operation. For instance,
            x = x + 10;

This can be written using a compound assignment as,
            x += 10;

The operator pair += tells the DM compiler to assign to x the value of x plus 10. The compound assignment simplifies the coding of a certain type of assignment statement.

Here is another example,
            x = x - 100;
It is the same as,
            x -= 100;

 

 

=================================================================================