Ask a Question

why does an empty structure take 2 byte memory space in c++?


Riya

on 2011-04-23 09:30:00  

A class (or struct) can have member functions without using any data members. Unless you can create an object of this class, you can\'t call the methods. For this reason, a class (or struct) that has no data members is created with a sizeof 1 byte.