Int main ()
{
Char a='9'.
Int b=a - '0';
Printf (" % d ", b);
return 0;
}
CodePudding user response:
Int b=atoi (a) - '0';CodePudding user response:
Where is your problemCodePudding user response:
Quite good, the output 9CodePudding user response:
The original poster is the problem? 0 ~ 9 corresponding ASCII value is val + '0', val of 0 ~ 9CodePudding user response:
This method is right, where is the problem?CodePudding user response:
The program no problem!CodePudding user response:
Beautifully written, there is no problemCodePudding user response:
Char number converted to type int is you this kind of writing.CodePudding user response:
Write so good, do not have what problemCodePudding user response:
Computer memory or file content or transport it is just a one-dimensional binary byte array and its corresponding binary address;The human brain to a computer memory or file contents or transfer the content of the one-dimensional binary byte array and its corresponding binary address some parts as an integer, number of signed/unsigned number, floating point Numbers, complex Numbers, letters, digits, Chinese/Korean/French... Character/string, assembly instructions, functions, function parameters, heap, stack, arrays, Pointers, array pointer and pointer array, the array of arrays, pointer to pointer, two-dimensional arrays, character lattice, the coordinates of character strokes, black and white binary images and grayscale images, color images, audio, video, fingerprint information, id information...
CodePudding user response:
Reduction before judgment about whether a '0' between '9' 0 'CodePudding user response:
So writing should be no problem, what are you trying to say?CodePudding user response:
Very good, there is no problemCodePudding user response:
Results 9CodePudding user response:
This is ill-chosen expression, when defining a variable assignment cannot directly to expressionCodePudding user response:
Minus the character 0 can solve this problemCodePudding user response:
CodePudding user response: