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
What is static in c++?
What are multiple inheritances (virtual inheritance)? What are its advantages and disadvantages?
What does iomanip mean in c++?
What is vector pair in c++?
Write some differences between an external iterator and an internal iterator?
Why can templates only be implemented in the header file?
Can we specify variable field width in a scanf() format string? If possible how?
What are enumerations?
What is a try block?
What is functions syntax in c++?
Differentiate between an external iterator and an internal iterator?
Should I learn c or c++ or c#?
What is math h in c++?
How can we check whether the contents of two structure variables are same or not?
Write a program to show polymorphism in C++?