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 the size of a class which contains no member
variables but has two objects??? is it 1 or 2??

Answer Posted / vasanth

class a
{
};
void main()
{
a obj1;
a obj2;
cout<<"sizeof class = "<<sizeof(a)<<endl<<"sixeof
obj1 = "<<sizeof(obj1)<<endl<<"sixeof obj2 = "<<sizeof(obj2)
<<endl;
}
--------------------
always sizeof the empty class is 1 byte and each object it
will tak 1 byte.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is best c++ or java?

1075


Why is that unsafe to deal locate the memory using free( ) if it has been allocated using new?

1062


What are the main features of c++?

994


Explain the isa and hasa class relationships.

1022


What is abstraction in c++ with example?

1092


What is a pointer how and when is it used?

1078


Explain explicit container.

1073


When we use Abstract Class and when we use Interface?where we will implement in real time?

2171


Explain the benefits of proper inheritance.

1136


How compile and run c++ program in turbo c++?

1161


What do you mean by public protected and private in c++?

1043


What is c++ stringstream?

1085


What is the error in the code below and how should it be corrected?

748


What is an object in c++?

1229


Is c++ still in demand?

1138