All pastes #256894 Raw Edit

Wolph

public c v1 · immutable
#256894 ·published 2006-11-24 19:30 UTC
rendered paste body
char * dec2bin(int number){    int i;    int max = 32;    char * output = malloc(max * sizeof(char) + 1);    for(i=0; i<max; i++){        output[max-i-1] = (number & (1 << i)) ? '1' : '0';    }    output[max] = '\0';    return output;}