C operators

Turbo C++ Operators

   [ ]              ( )                 .                 ->               ++                 --                  &      
   *                 +                 -                 ~                 !                 sizeof              /       
   %              <<               >>               <                 >                  <=                >=     
   ==             !=                ^                  |                 &&                ||                  ?:      
   =               *=               /=               %=               +=                -=               <<=     
   >>=          &=              ^=                |=                  ,                   #                 ##      


The following operators are specific to C++:

   ::       .*       ->*

The operators # and ## are used only by the preprocessor.

Depending on context, the same operator can have more than one meaning. For
example, the ampersand (&) can be interpreted as
  •  a bitwise AND (A & B).
  • an address operator (&A).
  • in C++, a reference modifier
In the first case, the & is a unary operator; in the second, the & is a
binary operator.

Post a Comment

0 Comments