Read Time:26 Second
Here’s a list of some other common operators available in C++
Operator | Description | Example |
---|---|---|
sizeof | returns the size of data type | sizeof(int); // 4 |
?: | returns value based on the condition | string result = (5 > 0) ? "even" : "odd"; // "even" |
& | represents memory address of the operand | # // address of num |
. | accesses members of struct variables or class objects | s1.marks = 92; |
-> | used with pointers to access the class or struct variables | ptr->marks = 92; |
<< | prints the output value | cout << 5; |
>> | gets the input value | cin >> num; |
[…] Other Operators […]