C++ operators
In C++, operators are symbols or keywords that perform specific operations on one or more operands.
Some of the most common operators in C++ include:
Arithmetic Operators:
+ (addition)
- (subtraction)
* (multiplication)
/ (division)
% (modulus)
Assignment Operators:=
(assignment)
+= (addition assignment)
-= (subtraction assignment)
*= (multiplication assignment)
/= (division assignment)
%= (modulus assignment)
Comparison Operators:=
= (equal to)
!= (not equal to)
< (less than)
> (greater than)
<= (less than or equal to)
>= (greater than or equal to)
Logical Operators:
(logical and)
|| (logical or)
! (logical not)
Bitwise Operators:
(bitwise and)
| (bitwise or)
^ (bitwise xor)
~ (bitwise not)
<< (left shift)
>> (right shift)
Increment and Decrement Operators:
++ (increment)
-- (decrement)
Ternary Operator:
?: (conditional operator)
Address and Indirection Operators:
(address-of operator)
* (dereference or indirection operator)
Member Access Operators:
(member access operator)
-> (member access through pointer operator)
These are just some of the most commonly used operators in C++. There are many other operators available, including function call operator, comma operator, sizeof operator, and more.
0 Comments