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

Answers were Sorted based on User's Feedback



why the size of an empty class is 1..

Answer / 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

why the size of an empty class is 1..

Answer / abhishek

its because an empty class makes an entry to symbol table (code segment)
which requires a symoblic mapping of 1 byte

Is This Answer Correct ?    9 Yes 4 No

why the size of an empty class is 1..

Answer / kamna

it is becuse each oject must have a different address.

Is This Answer Correct ?    10 Yes 5 No

why the size of an empty class is 1..

Answer / surender a

Because the fundamental size is a char [viz 1 byte by
default on any 32 bit or 64 bit machine].

Is This Answer Correct ?    5 Yes 7 No

Post New Answer

More C++ General Interview Questions

class professor {}; class teacher : public virtual professor {}; class researcher : public virtual professor {}; class myprofessor : public teacher, public researcher {}; Referring to the sample code above, if an object of class "myprofessor" were created, how many instances of professor will it contain? a) 0 b) 1 c) 2 d) 3 e) 4

4 Answers   Quark,


If there are 1 to 100 Numbers in array of 101 elements. Which is the easy way to find repeated number?

2 Answers   Persistent,


What is the two main roles of operating system?

0 Answers  


Which of the following operator cannot be overloaded?

2 Answers   TCL,


Explain about templates of C++.

0 Answers  


Explain the difference between class and struct in c++?

0 Answers  


Can java be faster than c++?

0 Answers  


What are c++ variables?

0 Answers  


why all c++ program must have default constructor?

6 Answers   IBM,


How should runtime errors be handled in c++?

0 Answers  


Why is it difficult to store linked list in an array?

6 Answers   Infosys, Lucent,


Why should you learn c++?

0 Answers  


Categories