1.

Member functions _____________________(a) Must be defined inside class body(b) Can be defined inside class body or outside(c) Must be defined outside the class body(d) Can be defined in another classThis question was addressed to me in a job interview.This key question is from Types of Member Functions in chapter Member Functions & its Types of Object Oriented Programming

Answer»

Right choice is (C) Must be defined outside the class body

The best explanation: The functions DEFINITIONS can be given inside or outside the body of class. If defined inside, general SYNTAX is used. If defined outside then the class name followed by scope RESOLUTION operator and then function name must be given for the DEFINITION.



Discussion

No Comment Found

Related InterviewSolutions