C++ Operators Tutorial

Ashutosh Kumar
By -
0

C++ has rich sets of operators that is used to describe the action to be perform on two data operands.

 

Arthematic

Operator that perform arthematic (numeric) operator such +, -, *, / or % is called arthematic operator.

Operator Meaning Example Answer
+ Addtion 8 + 13
+ Addtion 8 + 13
+ Addtion 8 + 13
+ Addtion 8 + 13
+ Addtion 8 + 13


Relational Operator

operator that show a relational comparison b/w two operand. all relational operator are binary operator
 
Operator Meaning Example
== equal to 5 == 5
== equal to 5 == 5
== equal to 5 == 5
== equal to 5 == 5
== equal to 5 == 5
== equal to 5 == 5


Logical Operator


&& Logical AND
|| Logical OR
! Logical NOT


Bitwise Operator


modifier for bits of the pattern of the variable.
 
& AND Bitwise
! OR Inclusive OR
^ XOR Exclusives OR
~ NOT Unary Complement (bit inversion)
<< SHL Shift left
>> SHR Shift Right


Precedence Operator



Precedence of Operator in C++ Programming
Precedence of operator in C/C++ Programming Language


Special Operator

These are the special operator in C.

increment decrement operator, sizeof operand, comma operator etc.

Comma operator is used to describe the multiple expression in single line by separating with (,) operator. 

sizeof operator return the size of bytes is taken by variable in memory.


Scape sequence


Scape sequence characters in C++

Punctuators


used for enhance the readability of and maintainability of program.


()     - Parenthesis used for function or class member method calls.
[]     - Bracket used for accessing data through array index.
{}    - Curly bracket used to declare body of function, class, method declaration.


Thanks for reading...

Tags:

Post a Comment

0Comments

✍️ Only article/post centric comments are allowed.
❌**No Spam**
❌**Advertisement**
❌**No abuse**
Rules strictly applied ✅

Post a Comment (0)