Question
Easy

In C++, an overloaded unary operator defined as a member function requires how many variables to be passed as function argument?

1
Zero
2
One
3
Two
4
An unary operator can not be overloaded
Question Details
Time to Solve: 12
Exam: HTET
Level/Paper: Level 3
Chapter: Object-Oriented Programming (C++)
Topic: OOP Concepts
Correct Answer
Option A
Explanation

The correct option is (1): When a unary operator (such as the logical NOT \!, increment ++, or unary negation -) is overloaded as a member function of a class in C++, it requires zero explicit arguments in its function signature. The essential principle here is the implicit this pointer. A unary operator operates on a single operand. For a member function, this single operand is the object on which…Read More

In c an overloaded - HTET Level 3 | Clear Cutoff