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 |
Is c++ a high level language?
Write a corrected statement in c++ so that the statement will work properly. x =+ 7;
What is the best c++ ide?
How a modifier is similar to mutator?
Is c++ a dying language?
What you mean by early binding and late binding? How it is related to dynamic binding?
How should a contructor handle a failure?
what is oops
What is an ABC: an "Abstract Base Class"?
Give 2 examples of a code optimization?
What is the main purpose of c++?
Distinguish between new and malloc and delete and free().