RAD Studio |  |

Binary Operators

These are the binary operators in CodeGear C++:

Arithmetic Operator | Description
+ | Binary plus (add)
— | Binary minus (subtract)
* | Multiply
/ | Divide
% | Remainder (modulus)

Bitwise Operator | Description
<< | Shift left
>> | Shift right
& | Bitwise AND
^ | Bitwise XOR (exclusive OR)
| | Bitwise inclusive OR

Logical Operator | Description
&& | Logical AND

Assignment Operator | Description
= | Assignment
*= | Assign product
/= | Assign quotient
%= | Assign remainder (modulus)
+= | Assign sum
—= | Assign difference
<<= | Assign left shift
>>= | Assign right shift
&= | Assign bitwise AND
^= | Assign bitwise XOR
|= | Assign bitwise OR

Relational Operator | Description
< | Less than
> | Greater than
<= | Less than or equal to
>= | Greater than or equal to
== | Equal to
!= | Not equal to

Component Selection Operator | Description
. | Direct component selector
-> | Indirect component selector

Class Member Operator | Description
:: | Scope access/resolution
.* | Dereference pointer to class member
->* | Dereference pointer to class member

Conditional Operator | Description
?: | Actually a ternary operator. For example: a ? x : y means "if a then x else y"

Comma Operator | Description
, | Evaluate

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!