Possible loss of precision; extracting char from string
- by Troy
I am getting a string from the user and then doing some checking to make sure it is valid, here is the code I have been using;
char digit= userInput.charAt(0) - '0';
This had been working fine until I did some work on another method, I went to compile and have been receiving a 'possible loss of precision' error since then.
What am I doing wrong?