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 there structure in c++?
What are inline functions?
Define friend function.
Name the operators that cannot be overloaded in C++?
what are difference between c and c++?
Write a corrected statement in c++ so that the statement will work properly. if (x = y) x = 2*z;
What do you mean by abstraction. Explain your answer?
What does return 0 do in c++?
What are the vectors in c++?
Write a Program for dynamically intialize a 2 dimentional array. Eg:5x20, accept strings and check for vowels and display the no.finally free the space allocated .
Is there a c++ certification?
Which is the best c++ software?