Horje
print binary c Code Example
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('\n', stdout);
}
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) * 8; i != -1; i--)
        printf("%d", (value & (1 << i)) >> i );
    putc('\n', stdout);
}




C

Related
C Variable Byte Sizes Code Example C Variable Byte Sizes Code Example
Cannot open include file: 'graphviz/cgraph.h' Code Example Cannot open include file: 'graphviz/cgraph.h' Code Example
Smallest c program ever Code Example Smallest c program ever Code Example
4k stogram chave Code Example 4k stogram chave Code Example
getch' was not declared in this scope Code Example getch' was not declared in this scope Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7