int i=0; void dec2yyy(int yyy,int source,char* bin) { if(source==0) return; dec2yyy(yyy,source/yyy,bin); if((source%yyy)<10) bin[i]=(char)(source%yyy+0x30); else bin[i]=(char)(source%yyy+0x37); i++; }
void dec2bin(char bin[], int num, int *i) { if (0 == num) { *i = 0; return; } dec2bin(bin, num / 2, i); bin[(*i)++] = num % 2 + '0'; }