Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is size of empty class object

Answer Posted / orvaishnavi

The size of an empty class is 1.
Reason - An object of a class should have unique address.
In order for the object to get unique address, the compiler
inserts a dummy type of size 1(least positive value) into
the empty class so the sizeof the class is returned as 1.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which compiler does turbo c++ use?

1023


Specify some guidelines that should be followed while overloading operators?

1134


What happens when you make call 'delete this;'?

1027


Why are pointers not used in c++?

1080


Why is main an int?

931


What is the role of static keyword for a class member variable?

1029


What is wrapper class in c++?

1041


Do vectors start at 0 c++?

979


Describe public access specifiers?

1038


What is const in c++?

1062


Difference between a homogeneous and a heterogeneous container

1090


What is ios :: in in c++?

1000


When does a 'this' pointer get created?

1033


How will you call C functions from C ++ and vice-versa?

1078


What are the differences between new and malloc?

1046