hi,
I want to know whether compiler implements bits padding in Classes as in structs??
eg:
if my struct is
struct info
{
char c;
int i;
};
Size of this structure would be 8 and not 5..(considering int is 4 bytes)
On similar grounds if my class is
class info
{
public:
char c;
int i;
};
Size of this class would be 8 always?
|
John Hoder
|
|
| 26Jul2011,13:29 | #2 |
|
the first one's size is 5 not 8 and the 2nd one's size is also 5 i think, 'couse public doesn't change anything.
|
|
Go4Expert Member
|
|
| 26Jul2011,14:01 | #3 |
|
Hello Scripting,
Thanks for the reply.. However,the size of structure would be 8 as 3 bytes would be padded after "char c" member |
