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

Can circle be called an ellipse?

1078


What apps are written in c++?

1100


Explain friend class?

1128


Will c++ be replaced?

1046


How the delete operator differs from the delete[]operator?

1097


Which function should be used to free the memory allocated by calloc()?

1025


Is string data type in c++?

1033


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

1076


What is searching?

1126


What is an accessor in c++?

1073


What is std :: flush?

1067


How we can differentiate between a pre and post increment operators during overloading?

1105


What is the function of I/O library in C++ ?

1190


What is iomanip c++?

1079


What is a c++ object?

1166