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 |
Which is best ide for c++?
Write a single instruction that will find the remainder of integral division when x is divided by y. Have the answer stored in z.
Write syntax to define friend functions in C++.
Explain deep copy and a shallow copy?
What are the characteristics of friend functions?
What is static in c++?
Out of fgets() and gets() which function is safe to use?
what are function pointers?
What is difference between c++ and c ++ 14?
Is map thread safe c++?
What are the benefits of pointers?
What is difference between shallow copy and deep copy? Which is default?