#define BYTESIZE 8
/*
**Print an integer argument as a binary string
*/
printbits(intval)
int intval;
{
int i;
for(i=0;i<BYTESIZE*SIZEOF(INT);++i)
printf("%d",(intval<<i&1<<BYTESIZE*sizeof(int)-1)?1:0);
putchar('\n');
}
/*
**Print an integer argument as a binary string
*/
printbits(intval)
int intval;
{
int i;
for(i=0;i<BYTESIZE*SIZEOF(INT);++i)
printf("%d",(intval<<i&1<<BYTESIZE*sizeof(int)-1)?1:0);
putchar('\n');
}
No comments:
Post a Comment