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
5.4k 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
6.0k points