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
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.
"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens
ah yes, you're right its actually 57. so there's no way of just normally adding or subtracting array values?