Conversion between char type and int type in C language

There are two ways to convert char and int, which are suitable for output
The easiest way is to use the difference of the ASSCII code and directly subtract '0' from the char value.

eg: char  a =  '9' ; int  a_ = a- '0' ; the other is to use the library function of c language to solve the ASCII control characters
attached to the ASSCII code table

Guess you like

Origin blog.csdn.net/qq_43445867/article/details/123707407