Technical Discussion :: C++
Home > Freshers > Technical Interview Questions > C++
3. Can we create an empty class? If so what would be the sizeof such object.
Answer:
Yes, Size of an empty class is not zero. It is 1 byte generally. It is nonzero to ensure that the two different objects will have different addresses.
Asked In :: TCS Capgemini Virtusa Syntel Inc. Societe Generale
Yes, Size of an empty class is not zero. It is 1 byte generally. It is nonzero to ensure that the two different objects will have different addresses.