why size of blank class is 1?
Size of blank class
Collapse
X
-
Tags: None
-
-
In C++ a class with no data members has a sizeof 1 regardless of the number methods for the class. This permits you to create a pointer to an object of this class.
Should one of the methods be virtual you will see the size increase from 1 to 4 (32-bit OS) to allow you access to the VTBL for polymorphism.Comment
Comment