C++ Other Operators for beginners to expert

0 0
Read Time:26 Second

Here’s a list of some other common operators available in C++

OperatorDescriptionExample
sizeofreturns the size of data typesizeof(int); // 4
?:returns value based on the conditionstring result = (5 > 0) ? "even" : "odd"; // "even"
&represents memory address of the operand# // address of num
.accesses members of struct variables or class objectss1.marks = 92;
->used with pointers to access the class or struct variablesptr->marks = 92;
<<prints the output valuecout << 5;
>>gets the input valuecin >> num;
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

One thought on “C++ Other Operators for beginners to expert

Leave a Comment