1.

Object declared in main() function _____________(a) Can be used by any other function(b) Can be used by main() function of any other program(c) Can’t be used by any other function(d) Can be accessed using scope resolution operatorThis question was posed to me in homework.My enquiry is from Objects topic in section OOPs Concept & Features of Object Oriented Programming

Answer»

Right choice is (C) Can’t be used by any other function

For explanation: The OBJECT declared in main() have local scope inside main() function only. It can’t be used OUTSIDE main() function. Scope RESOLUTION operator is used to access GLOBALLY declared variables/objects.



Discussion

No Comment Found

Related InterviewSolutions