1.

Which operator can be used to check the size of an object?(a) sizeof(objectName)(b) size(objectName)(c) sizeofobject(objectName)(d) sizedobject(objectName)The question was posed to me in final exam.The doubt is from Memory Allocation of Object in portion Object of Object Oriented Programming

Answer»

Correct answer is (a) SIZEOF(objectName)

Explanation: The sizeof operator is used to get the size of an already CREATED object. This operator MUST constail keyword sizeof(objectName). The output will give the NUMBER of bytes acquired by a SINGLE object of some class.



Discussion

No Comment Found

Related InterviewSolutions