Home > Back-end >  The small white, 1 and the integer 1 characters
The small white, 1 and the integer 1 characters

Time:10-07

A character is converted to the integer 1 minus 48, but why ah, didn't see the two type in ASCII code?

CodePudding user response:

In ASCII code table, 48 ~ 57 of 0 to 90 digits
Characters' 1 '==49,
To switch to the integer 1='1' - 48

CodePudding user response:

LZ can print characters 1 and see how many, then I know how to turn this into a plastic 1
Printf (" % d ", '1');//print characters and see how much is 1?

CodePudding user response:

49. The ASCII '1' is' 0 'is 48

CodePudding user response:

There is no need to remember,
'1' - '1 + 1;
Came into this
Character turn number
S [I] - '0'

CodePudding user response:

Number of characters in the ASCII table is arranged inside the
So, 1='1' - '0'. 2='2' - '0',...
Look at what is' 0 'ASCII, 48
So 1='1' - 48

CodePudding user response:

Know the thank you
  • Related