JustKernel

Ray Of Hope

bitwise

bitwise operations

Assignment to 4 bit #include <stdio.h> typedef unsigned char uint8; struct nib { uint8 an_term_tp:4, cn_term_tp:4; }; void main() { int an_term = 1; int cn_term = 2; uint8 ch; struct nib nib_obj; ch = *(char *)(int *)&an_term; printf(“%d\n “, ch); if (ch == 1) printf(“\n little endian”); nib_obj.an_term_tp = (char)(an_term) & 0x0f; nib_obj.cn_term_tp = […]

Tags:

Posted in Basic C | No Comments »