📅  最后修改于: 2022-03-11 14:44:51.826000             🧑  作者: Mango
char hex[] = "6A"; // here is the hex string
int num = (int)strtol(hex, NULL, 16); // number base 16
printf("%c\n", num); // print it as a char
printf("%d\n", num); // print it as decimal
printf("%X\n", num); // print it back as hex