Last active
August 24, 2022 01:44
-
-
Save ISDementyev/3e0094b41b64d5aa0196a704d0d4f0a9 to your computer and use it in GitHub Desktop.
Allows conversion of chars to ints
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int CharToInt(char Digit) | |
{ | |
return (int)Digit - 48; | |
} | |
int main() | |
{ | |
int Int6 = CharToInt('6'); | |
printf("Int: %d", Int6); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment