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 C++ exceptional handling?

1192


What is the difference between public and private data members?

1194


Difference between pointer to constant and constant pointer to a constant. Give example.

1136


What is anonymous object in c++?

1107


How is c++ used in the real world?

1056


Does a derived class inherit or doesn't inherit?

1102


What's the hardest coding language?

1019


what is a class? Explain with an example.

1151


What are c++ data types?

1180


What is the difference between global variables and local variable

1079


What are arrays c++?

1121


How a macro differs from a template?

1184


What are shallow and deep copy?

1138


Why is c++ is better than c?

996


Write an algorithm that determines whether or not an almost complete binary tree is a heap.

3935