diff --git a/src/conversionOfNumbers/conversionOfNumbers.c b/src/conversionOfNumbers/conversionOfNumbers.c index 6a92ed7..0d828bc 100644 --- a/src/conversionOfNumbers/conversionOfNumbers.c +++ b/src/conversionOfNumbers/conversionOfNumbers.c @@ -51,6 +51,18 @@ unsigned int convertBinaryStrToInt(char* input){ return result; } +int hexStrLen(int input){ + int length = 0; + if(input == 0) return 1; + for (int x = 0; x <= input; x++){ + if(pow(16,x) >= input + 1){ + length += x; + break; + } + } + return length; +} + char* convertIntToHex(int input){ int length = 1; int rest;