[ create a new paste ] login | about

Link: http://codepad.org/MWKgGp6A    [ raw code | output | fork ]

EnzoFerber - C, pasted on Nov 30:
1
2
3
4
5
6
7
8
9
void makebin(int d){
char str[9];
register int i;
for ( i = 0; i < 8; i++) str[i] = (d & 0x80 >> i) ? '1' : '0';
str[8] = 0x0;
printf("%s", str);
}

main(){ makebin(65); return 0; }


Output:
1
01000001


Create a new paste based on this one


Comments: