So I have an array : isbn[20][20]
and then i input : 978-0-306-4061
then i try to multiply the first character, 9, by one :
s = isbn[0][0] * 1;
and instead of 9 i get.. 56.. i don't get why.
Any ideas?
Thanks
Printable View
So I have an array : isbn[20][20]
and then i input : 978-0-306-4061
then i try to multiply the first character, 9, by one :
s = isbn[0][0] * 1;
and instead of 9 i get.. 56.. i don't get why.
Any ideas?
Thanks
The ascii value for the representation of the char '9'. (Although according to asciitable.com it's 57 not 56).
If you want to convert that to the numeric value of 9 then you'd need to subtract char '0' first.
ah yes, you're right its actually 57. so there's no way of just normally adding or subtracting array values?