How size of a class can be calulated?
Answers were Sorted based on User's Feedback
Answer / spoorthi.hebbar
THE SIZE OF THE ATTRIBUTES OF CLASS IS THE ANSWER..
EG.
CLASS DEMO
{
INT A; //IT IS 4 BYTES LONG
INT B; //IT IS 4 BYTES LONG
}
THE TOTAL SIZE IS 8 BYTES.
| Is This Answer Correct ? | 8 Yes | 2 No |
Answer / 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 |
What is Name Decoration?
What is the return value of the insertion operator?
Write about the local class and mention its use?
What is meant by iomanip in c++?
Can I learn c++ in a week?
What are the types of pointer?
How do you compile the source code with your compiler?
Explain terminate() function?
What is the difference between a definition and a declaration?
Explain binary search.
What is size of string in c++?
What is the Diffrence between a "assignment operator" and a "copy constructor"?