Why not just use sscanf? This supports a ton of destination types and also error handling:
#include <stdio.h>
int main() {
const char *str = "12345";
unsigned int value;
if (sscanf(str, "%u", &value) == 1) {
printf("The converted unsigned integer is: %u\n", value);
} else {
puts("Conversion failed.");
}
return 0;
}