Google News
logo
CPP - Quiz(MCQ)
Pick up the valid declaration for overloading ++ in postfix form where T is the class name.
A)
T operator++(int);
B)
T& operator++(int);
C)
T operator++();
D)
T& operator++();

Correct Answer :   T operator++(int);


Explanation : The parameter int is just to signify that it is the postfix form overloaded. Shouldn’t return reference as per its original behavior.

Advertisement