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 a empty class?

Answer Posted / shiv chidambar

size of empty class is 1 byte.
because to indicate class existance in memory 1 byte is
allocated to indicate that class is present.

if the class is empty then there should some kind of
mechanism to indicate or to show this class is present.
if memory (1 byte) not alloacted such a empty class then how
we know that class is present but in programme that class is
written? so for that 1 byte allocated to indicate class
existance.
this happens only for emty classes(Consider example of
tagging interface in java which is empty class).

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How static variables and local variablesare similar and dissimilar?

1047


How does a C++ structure differ from a C++ class?

1133


Const char *p , char const *p What is the difference between the above two?

1221


If we want that any wildcard characters in the command line arguments should be appropriately expanded, are we required to make any special provision? If yes, which?

1517


Discussion on error handling of C++ .

1128


Where Malloc(), Calloc(), and realloc() does get memory?

1062


What is the correct syntax for inheritance a) class aclass : public superclass b) class aclass inherit superclass c) class aclass <-superclass

1201


How can you link a c program with a c function?

1082


why is c++ called oops? Explain

1054


Comment on assignment operator in c++.

1127


Mention the ways in which parameterized can be invoked. Give an example of each.

1068


Explain the use of virtual destructor?

1081


What is #include math h in c++?

1101


what are Access specifiers in C++ class? What are the types?

1238


How to get the current position of the file pointer?

1051