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

What is static in c++?

1059


What are multiple inheritances (virtual inheritance)? What are its advantages and disadvantages?

1056


What does iomanip mean in c++?

1203


What is vector pair in c++?

1225


Write some differences between an external iterator and an internal iterator?

1021


Why can templates only be implemented in the header file?

1108


Can we specify variable field width in a scanf() format string? If possible how?

1260


What are enumerations?

1106


What is a try block?

1074


What is functions syntax in c++?

1141


Differentiate between an external iterator and an internal iterator?

998


Should I learn c or c++ or c#?

1009


What is math h in c++?

1177


How can we check whether the contents of two structure variables are same or not?

1071


Write a program to show polymorphism in C++?

1148