What are the different operators in C++?

Answer Posted / shweta iyer

1)Arithmetic: for general arithmetic operations. They are "+,-, *,/,%".

2)Relational: for performing operations based on relations.They are ">,<,>=,<=,==,!=".

3)Logical: for performing ooperations based on some logics.They are "AND,OR,NOT".

4)Conditional: it works as simple if-else.It is "?:"

5)Assignment: used to assign some values to the variables. It is "="

6)Increment/Decrement: used to increase or secrease the value of any variable. They are : "++" for increment and "--" for decrement.

7)Bitwise: used to perform operations on bits. They are "&,^,<<,>>"

8)insertion : used to display any value or statement on screen. It is "<<"

9)extraction : used for input. It is ">>"

10)scope resolution: to define the scope of a function member. It is "::"

11)field width: used to set wiidth of the field. It is "setw"

12)memory allocation: to allocate new spaces in memory. It is "new".

13)memory release: to free the memory. It is "delete".

14)line feed: It is used to provide a new line. It is "endl".

15)pointer to member: it is used for pointers. It is .* and .->

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is endianness?

624


Are php strings immutable?

565


What do you mean by persistent and non persistent objects?

742


What is buffering in c++?

589


Describe linkages and types of linkages?

570






Is facebook written in c++?

564


What will happen if a pointer is deleted twice?

726


Explain what is polymorphism in c++?

629


How to defines the function in c++?

624


Is it possible to get the source code back from binary file?

717


Why main function is special in c++?

670


Describe exception handling concept with an example?

563


What is an inline function in c++?

629


Tell me what are static member functions?

616


What is decltype c++?

559