@ -50,3 +50,19 @@ unsigned int convertBinaryStrToInt(char* input){
}
return result;
char* convertIntToHex(int input){
int length = 1;
int rest;
char* result = (char*)malloc(sizeof(char) * length + 1);
result[length] = '\0';
do{
rest = input % 16;
input /= 16;
switch(rest){
default: result[length - 1] = rest + '0'; break;
length--;
}while(input != 0);