What is the difference in size of this two clasees?
Class A
{
int a;
char c;
float f;
}
Class B
{
float f;
char c;
int a;
}
Answer Posted / som shekhar
well there will be no difference..define the macro
#pragma pack(1) and then calculate the size of the class....
Actually compiler aligns the boundary to the nearest larger
byte. If you define the aforementioned macro, compiler will
give you the exact size of the class.
Hope that is clear.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Write my own zero-argument manipulator that should work same as hex?
What is set in c++?
Write a program in C++ for Fibonacci series
What is a v-table?
Which should be more useful: the protected and public virtuals?
What are libraries in c++?
What is the last index number in an array of 100 characters a) 100 b) 99 c) 101
What is the use of 'this' pointer?
What is fflush c++?
Explain the uses oof nested class?
What is tellg () in c++?
What do you mean by function pointer?
What size is allocated to the union variable?
What is array give example?
Differentiate between declaration and definition.