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 difference between c++ 11 and c++ 14?
Explain one-definition rule (odr).
What is a constant? Explain with an example.
What is the use of "new" operator?
Discuss the possibilities related to the termination of a program before entering the mainq method?
Can we run c program in turbo c++?
Explain 'this' pointer and what would happen if a pointer is deleted twice?
Define a program that reads two matrices of size 3x3 with real values from the user then prints their sum, difference and multiplication.
Write a C/C++ program to show the result of a stored procedure "PROC_RESET_MAIL" on database "USER_NOTIFY".
2 Answers ABC, Accenture, DataLand, HCL, Webyog,
Differentiate between an array and a list?
Difference between declaration and definition of a variable.
What is difference between class and function?