1.

The non-template functions can be added with default arguments to already declared functions ____________________(a) If and only if the function is declared again in the same scope(b) If and only if the function is declared only once in the same scope(c) If and only if the function is declared in different scope(d) If and only if the function is declared twice in the programThe question was asked during an online exam.Question is taken from Default Arguments topic in portion Default Arguments vs Overloading, Upcasting and Downcasting of Object Oriented Programming

Answer»

Right answer is (a) If and only if the function is declared again in the same scope

To EXPLAIN I WOULD say: The non-template functions can also be added with default arguments. This can be done even if the functions were defined earlier. This is because the call to the function won’t be affected. The function can still be USED in the same way as it was used earlier.



Discussion

No Comment Found

Related InterviewSolutions