hey,
I've got a stupid little problem holding up a whole project. My class basically tries to mock the BigInteger class. It takes in a string and stores the value as an array of integers. My problem is that when I take the individual chars and try to convert them into an integer, the wrong number is stored. For example...1 = 49, 2 = 50, 3 = 51, etc.
Here's the relevant code:
charToInt = val.charAt(size); //charToInt is type char
input = (int) charToInt; //input is type int
num = input; // at this point the number is f'd
any ideas? I can't use parseInt because it's a char, not a string.
Thanks.
I've got a stupid little problem holding up a whole project. My class basically tries to mock the BigInteger class. It takes in a string and stores the value as an array of integers. My problem is that when I take the individual chars and try to convert them into an integer, the wrong number is stored. For example...1 = 49, 2 = 50, 3 = 51, etc.
Here's the relevant code:
charToInt = val.charAt(size); //charToInt is type char
input = (int) charToInt; //input is type int
num = input; // at this point the number is f'd
any ideas? I can't use parseInt because it's a char, not a string.
Thanks.