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
What is abstraction in c++ with example?
What is c++ try block?
How can an improvement in the quality of software be done by try/catch/throw?
How to tokenize a string in c++?
Is c++ a programming language?
What does ios :: app do in c++?
What is oops in c++?
Is c++ an oop?
What is a linked list in c++?
Which compiler does turbo c++ use?
Is ca high or low level language?
Explain deep copy and a shallow copy?
What are literals in C++?
What would happen on forgetting [], while deallocating an array through new?
Is there structure in c++?