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 you please explain the difference between static and dynamic binding of functions?

969


What are the various storage classes in C++?

1086


Should I learn c++ c?

999


Does there exist any other function which can be used to convert an integer or a float to a string?

1026


What are the unique features of C++.

1030


Explain how overloading takes place in c++?

970


What do you mean by function overriding & function overloading in c++?

1095


What is the full name of logo?

1060


Is python written in c or c++?

1084


How do I make turbo c++ full screen?

1024


What is c++ programming language?

1049


Is it possible for the objects to read and write themselves?

1051


What is std :: flush?

1002


What parameter does the constructor to an ofstream object take?

1003


how to access grid view row?

2166