Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to convert the number of characters into integers without library functions in C language?
How to convert the number of characters into integers without library functions in C language?
You can subtract the number of characters from the character 0 to get the number of plastics you want. For example, the following example changes the character 1 to the integer 1.

char c = ' 1 ';

printf("%d\n ",c-' 0 ');

I don't know if you want this effect.