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

Difference between strdup and strcpy?

1252


What is the difference between public, private, and protected access?

1134


How do you establish an is-a relationship?

1217


What is abstraction c++?

1059


Tell me difference between constant pointer and pointer to a constant.

1278


How can you quickly find the number of elements stored in a static array? Why is it difficult to store linked list in an array?

1026


Write a program to find the reverse Fibonacci series starting from N.

1352


What c++ is used for?

1153


What is the use of turbo c++?

1111


what you know about c++?

1201


Why c++ is called oop?

1177


What is oop in c++?

1130


Define a constructor?

1109


How much do c++ programmers make?

1163


What is the sequence of destruction of local objects?

1028