i'm taking the value in through the argument, so that argv[1] is "8 C" (i'm playing around with a cards simulation). I'm putting argv[1] into a string then trying to say, short test = mystring[0];
how can i get the real value, rather than the ascii-character value?
If 57 is the ASCII value of '9' and 48 is the ASCII value of '0', then n will be assigned 57 - 48, which is 9. This will work for any ASCII digit character.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.