Route guide from character 1 to number 1

1

atoi();
itoa();
or forced type conversion, etc.

2

Converted to number 1: 1-'0';//1 is character type
Converted to character 1: '0'+1;//1 is integer type

3

atoi(); characters are converted to numbers
itoa(); numbers are converted to characters

4

‘1’-48;
char(1+48);

5

‘1’-0x30;
char(1+0x30);

6

The difference between the decimal number is 48

7

Look at the ASCII table

8

1=‘1’-‘0’

‘1’=1+‘0’

This is simple enough, don’t remember what the difference is

9

Check the Ascii table

10

1-0=‘1’-‘0’
‘1’=1+‘0’-0

Guess you like

Origin blog.csdn.net/qq_45849625/article/details/113399755