Disable ads (and more) with a membership for a one time $2.99 payment
What does the 'sizeof' operator return when applied to a class derived through inheritance?
The size of the base class
The size of the derived class
The combined size of the base and derived classes
Cannot be determined
The correct answer is: The size of the derived class
The 'sizeof' operator returns the size of the derived class when applied to a class derived through inheritance. This is because a derived class inherits all of the non-static members and member functions of the base class, thus the size of the derived class includes the size of the base class as well. Options A and C are incorrect as they refer to the size of the base and derived classes combined, while option D is incorrect as it implies that the 'sizeof' operator cannot determine the size of a derived class, which is not true.