1.

If a class have a public member function and is called directly in the main function then ___________________________(a) Undeclared function error will be produced(b) Out of memory error is given(c) Program gives warning only(d) Program shut down the computerThe question was asked in quiz.Enquiry is from Public Member Functions in section Member Functions & its Types of Object Oriented Programming

Answer» RIGHT choice is (a) Undeclared function error will be produced

The best EXPLANATION: If the function is called directly WITHOUT using any object then the compiler doesn’t gets to know that the function have to be called from a SPECIFIC CLASS. And if there are no global or in-scope function with same name then the compiler produces an error stating that the called function is undeclared.


Discussion

No Comment Found

Related InterviewSolutions