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...

why the size of an empty class is 1

Answer Posted / hitesh sojitra

When you calculate the size of a empty class that time you can c it takes 1 byte.which is the size of a char which a compiler takes for storing the address of a empty class.

The size of an empty class would depend on what is the range specified for the compiler for char. It takes that much space to store the address of a class.

Is This Answer Correct ?    13 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is #include iostream?

1255


To what does “event-driven” refer?

1061


What is a loop? What are different types of loops in c++?

1133


Why do we use double in c++?

1073


State the difference between delete and delete[].

1107


What is a v-table?

1185


If horse and bird inherit virtual public from animal, do their constructors initialize the animal constructor? If pegasus inherits from both horse and bird, how does it initialize animal’s constructor?

1212


How can an improvement in the quality of software be done by try/catch/throw?

1069


What does catch(…) mean?

1119


Difference between overloading vs. Overriding

1090


Explain the concept of friend function in c++?

1118


What is the difference between a template and a macro?

1067


How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

1097


How do you invoke a base member function from a derived class in which you’ve overridden that function?

1116


Which ide is best for c++?

1050