[ create a new paste ] login | about

Link: http://codepad.org/yoimSGDu    [ raw code | output | fork ]

C, pasted on Jul 28:
#include<stdio.h>



typedef struct Divide8Bits_t
{
 unsigned char firstHalf:4;
 unsigned char secondHalf:4;
}Divide8Bits;

unsigned char FIL_historyTable = 240 ;
int main()
{

unsigned char wlgroup =0; 
Divide8Bits *ptr = (Divide8Bits *)&FIL_historyTable;

if( !(wlgroup&0x1) )
ptr->firstHalf = 15; // example 
else
ptr->secondHalf = 10; // example 

printf("val first=%d\n",ptr->firstHalf );
printf("val second =%d\n",ptr->secondHalf);

}


Output:
1
2
3
4
val first=15
val second =15

Exited: ExitFailure 15


Create a new paste based on this one


Comments: