Pages

21 Apr 2012

C++ Empty class?

Yes, cpp allows to declare empty class and create instance of it.

Interestingly as per cpp standards no two objects share same memory, hence compiler inserts one byte to empty class making it have a size of 1 byte at run time.

No comments:

Post a Comment