“Binärdrucken in c” Code-Antworten

Drucken binär 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);
}
Yasha

Binärdrucken in c

void print_bin(unsigned char value)
{
    for (int i = sizeof(char) * 7; i >= 0; i--)
        printf("%d", (value & (1 << i)) >> i );
    putc('\n', stdout);
}
SIVASANJEEV R

Drucken binär 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);
}

Ähnliche Antworten wie “Binärdrucken in c”

Fragen ähnlich wie “Binärdrucken in c”

Weitere verwandte Antworten zu “Binärdrucken in c” auf C

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen