hello,
I have a structure when i print the size of struture i get different values printed can anyone explain:
struct m{
unsigned int i;
unsigned long int j;
unsigned int l;
unsigned int k:2;
unsigned int m:2;
};
size is:24
what about bit fields????
struct m{
unsigned int i;
unsigned long int j;
unsigned int l;
unsigned int k:2;
unsigned int m:2;
}__attribute__( (__packed__));
size is:17
again what about bit fields???
the size of int on my machine is 32bits..
I have a structure when i print the size of struture i get different values printed can anyone explain:
struct m{
unsigned int i;
unsigned long int j;
unsigned int l;
unsigned int k:2;
unsigned int m:2;
};
size is:24
what about bit fields????
struct m{
unsigned int i;
unsigned long int j;
unsigned int l;
unsigned int k:2;
unsigned int m:2;
}__attribute__( (__packed__));
size is:17
again what about bit fields???
the size of int on my machine is 32bits..
Comment