Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

print binary c

// Note that u can change this function to print int values
// by changing the type and the sizeof 
void print_bin(unsigned char value)
{
    for (int i = sizeof(char) * 7; i >= 0; i--)
        printf("%d", (value & (1 << i)) >> i );
    putc('
', stdout);
}
 
PREVIOUS NEXT
Tagged: #print #binary
ADD COMMENT
Topic
Name
7+8 =