1.

What should be done for data member to be of user defined structure type?(a) The structure must have been defined before class.(b) The structure must have been defined after the class definition(c) The structure must be predefined(d) The structure type data members can’t be usedThe question was posed to me in semester exam.My question is from Data Members topic in division Class Members & Types of Object Oriented Programming

Answer»

Correct option is (a) The STRUCTURE must have been defined before class.

The EXPLANATION is: The structure must have been defined prior to its use. If the structure is not defined, then the memory space will not be allocated for its MEMBERS. This LEADS to undefined use of new data TYPES.



Discussion

No Comment Found

Related InterviewSolutions