Browse Source

implemented hexStrLen function into to convert function to dynamically determine hex string length

remotes/origin/conversionOfNumbers
Laurin 11 months ago
parent
commit
2800426e7c
  1. 2
      src/conversionOfNumbers/conversionOfNumbers.c

2
src/conversionOfNumbers/conversionOfNumbers.c

@ -64,7 +64,7 @@ int hexStrLen(int input){
} }
char* convertIntToHex(int input){ char* convertIntToHex(int input){
int length = 1;
int length = hexStrLen(input);
int rest; int rest;
char* result = (char*)malloc(sizeof(char) * length + 1); char* result = (char*)malloc(sizeof(char) * length + 1);
result[length] = '\0'; result[length] = '\0';

Loading…
Cancel
Save