<< Previous Next >>
/* Function that gets n bits from postion p. */ #include <stdio.h> unsigned getbits(unsigned x, int p, int n); main() { printf("%u\n",getbits(58,4,3)); } unsigned getbits(unsigned x, int p, int n) { return x>>p+1-n & ~(~0<<n); }
Home Forum Guestbook Email Us About Us Links More
encoders.20m.com - hosted at 20m.comSite design and development by Susam Pal-----------------------------------------------------