char asciiHex[sizeof(kolchislo)];
memcpy(asciiHex, kolchislo, 2);
int decValue = strtol(asciiHex, NULL, 16);
// Добавление +1
decValue += 1;
snprintf(asciiHex, sizeof(asciiHex), "%X", decVal)
.unsigned int str_to_uint(char *str) {
unsigned int result = 0;
while (*str != '\0') {
result = result * 10 + *str - '0';
}
return result;
}
void uint_to_str(unsigned int val, char *buf, int bufsize) {
unsinged int div = 1;
while (val / div > 10) {
div *= 10;
}
while (div > 0 && bufsize > 1) {
*(buf++) = '0' + (val / div);
val = val % div;
div /= 10;
bufsize -= 1;
}
*buf = '\0';
return;
}