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

What are register variables?

1154


Can I run c program in turbo c++?

1038


Can a program run without main?

1246


What is else syntax in c++?

1210


What is istream c++?

1199


What are the two types of comments?

999


Can I make ios apps with c++?

1053


What is #include math h in c++?

1095


How does atoi function work?

1156


describe private access specifiers?

1241


What is array give example?

1051


Why is c++ still used?

1091


What is atoi?

973


Evaulate: 22%5 a) 2 b) 4 c) 0

1095


What is a null object in c++?

1234