1.

Which keyword is used to define the inline member function?(a) no keyword required(b) inline(c) inlined(d) lineThis question was posed to me in a national level competition.This intriguing question comes from Types of Member Functions in division Member Functions & its Types of Object Oriented Programming

Answer»

Right choice is (b) inline

To explain: The inline keyword is used to defined the inline MEMBER functions in a class. The functions are IMPLICITLY MADE inline if defined inside the class body, but only if they doesn’t have any complex STATEMENT inside. All functions defined outside the class body must be mentioned with an explicit inline keyword.



Discussion

No Comment Found

Related InterviewSolutions