C
Claudio
     printf ("\n %u " , sizeof ( ub ) ) ;
     printf ("\n %u " , sizeof ( sb ) ) ;
     printf ("\n %u " , sizeof ( n ) ) ;
     printf ("\n %u " , sizeof ( char ) ) ;
     ub.c = 'a' ;
     printf ("\n\n %c " ,  ub.c ) ;
     printf ("\n %u " ,  ub.a.high ) ;
     printf ("\n %u " ,  ub.a.low ) ;
my output :
8
8
4
1
a
97
9515004 [root@localhost home]
***************************************************
this is my output i have compiled with g++ in fedora core 2
question was : the amount of memory struct snibble use
i thinked struct of bit (snibble) ,
you can see,
get at most 4 bit in memory and not 4 bytes.
struct snibble {
unsigned a : 1 ;
unsigned b : 1 ;
unsigned c : 1 ;
unsigned d : 1 ;
} ;
tomorrow i try disassemble program and see even bits are bits or bytes !?
thx a lot
claudio
     printf ("\n %u " , sizeof ( sb ) ) ;
     printf ("\n %u " , sizeof ( n ) ) ;
     printf ("\n %u " , sizeof ( char ) ) ;
     ub.c = 'a' ;
     printf ("\n\n %c " ,  ub.c ) ;
     printf ("\n %u " ,  ub.a.high ) ;
     printf ("\n %u " ,  ub.a.low ) ;
my output :
8
8
4
1
a
97
9515004 [root@localhost home]
***************************************************
this is my output i have compiled with g++ in fedora core 2
question was : the amount of memory struct snibble use
i thinked struct of bit (snibble) ,
you can see,
get at most 4 bit in memory and not 4 bytes.
struct snibble {
unsigned a : 1 ;
unsigned b : 1 ;
unsigned c : 1 ;
unsigned d : 1 ;
} ;
tomorrow i try disassemble program and see even bits are bits or bytes !?
thx a lot
claudio