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

Is it possible to provide default values while overloading a binary operator?

1268


What is fixed in c++?

1040


What is friend class in c++ with example?

1050


int age=35; if(age>80) {Console.WriteLine("Boy you are old");} else {Console.WrieLine("That is a good age");}

1262


Am pass the 10000 records to target in target I will take commit interval 15000 when I was stop the work flow what will happened

1563


Define upcasting.

1047


What is a down cast?

1114


If there are two catch statements, one for base and one for derived, which should come first?

1035


Is c++ platform dependent?

1085


Difference between a homogeneous and a heterogeneous container

1146


What are the manipulators in c++?

1041


Explain the concept of friend function in c++?

1121


which of the following is not an secondary constant a) array b) real c) union

1806


Can we specify variable field width in a scanf() format string? If possible how?

1271


What is iomanip c++?

1081