197k views
0 votes
Question text

If operator+ is supported by a class, how many parameters should it be defined to accept?

Select one:

a. 1 or 2

b. 2

c. 3

d. 1

e. None

User Cdonner
by
8.3k points

1 Answer

1 vote

Answer:

b. 2

Step-by-step explanation:

As we know operator + is supported by the class.Since we know that the + operator binary operator means it needs two operands to work upon it cannot work on one operand.++ operator is unary operator it works on one operand only.

For example:-

a+b

a++.

Hence we conclude that the answer is 2.

User Fetty
by
8.7k points

No related questions found

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.