| ??? 07/22/04 10:04 Read: times |
#74675 - RE: decimal to hexadecimal Responding to: ???'s previous message |
char* dectohex(char* dec)
{
char* hex;
int bin;
int check;
hex=(char*) malloc(4);
if(hex==NULL) exit(-1);
bin=atoi(dec);
if(bin==0 && dec[0]!='0') exit(-2);
check=sprintf(hex,"%X",bin);
if(check!=1) exit(-3);
return hex;
}
Sorry for being evil ;) (as you see there's no task so simple you can't make it hard) |
| Topic | Author | Date |
| decimal to hexadecimal | 01/01/70 00:00 | |
| RE: decimal to hexadecimal | 01/01/70 00:00 | |
| RE: decimal to hexadecimal | 01/01/70 00:00 | |
| RE: decimal to hexadecimal | 01/01/70 00:00 | |
| RE: decimal to hexadecimal | 01/01/70 00:00 | |
| RE: decimal to hexadecimal | 01/01/70 00:00 | |
| RE: decimal to hexadecimal | 01/01/70 00:00 | |
| RE: decimal to hexadecimal | 01/01/70 00:00 | |
RE: decimal to hexadecimal | 01/01/70 00:00 |



