1.

If static data members have to be used inside a class, those member functions _______________(a) Must not be static member functions(b) Must not be member functions(c) Must be static member functions(d) Must not be member function of corresponding classI had been asked this question in exam.My enquiry is from Static Data Members topic in portion Exception Handling & Static Class Members of Object Oriented Programming

Answer»

Right option is (C) Must be static member functions

The EXPLANATION is: Only the static member functions can ACCESS the static data members. The definition of static members is MADE common and hence the member function should be capable of manipulating the static data members.



Discussion

No Comment Found

Related InterviewSolutions