1.

The result of sizeof() function __________________(a) Includes space reserved for this pointer(b) Includes space taken up by the address pointer by this pointer(c) Doesn’t include the space taken by this pointer(d) Doesn’t include space for any data memberThe question was posed to me during an interview.The question is from This Pointer in section Assigning Object, Pointer to Objects, Passing and Returning Object of Object Oriented Programming

Answer»

Correct option is (C) Doesn’t include the space TAKEN by this pointer

The BEST I can EXPLAIN: The space taken by this pointer is not reflected in by the sizeof() operator. This is because object’s this pointer is not part of object itself. This is a cross verification for the concept stating that this pointer doesn’t TAKE any space in the object.



Discussion

No Comment Found

Related InterviewSolutions