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...

How size of a class can be calulated?

Answer Posted / shweta iyer

Size of a class can be calculated by adding up the size of all its data members.

For example:
class student
{
char name[20]; -----> 4*20=80
int rollno[5]; -----> 2*5=10
......
}

So size of class student is 80+10=90.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Mention the storage classes in c++.

1069


What happens when you make call 'delete this;'?

1066


What are static variables?

1122


How do I tokenize a string in c++?

1074


Write about a nested class and mention its use?

1088


What are c++ stream classes?

1038


Define a nested class.

1063


What happens if a pointer is deleted twice?

1263


Is c++ a dying language?

1138


Define the process of handling in case of destructor failure?

1041


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

1092


What is object in c++ example?

1093


Why is null pointer used?

1157


What is a responder chain?

1046


Where and why do I have to put the "template" and "typename" keywords?

1021