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
This is a discussion on array multiplication odd output within the C++ Programming forums, part of the General Programming Boards category; So I have an array : isbn[20][20] and then i input : 978-0-306-4061 then i try to multiply the first ...
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.
I used to be an adventurer like you... then I took an arrow to the knee.
ah yes, you're right its actually 57. so there's no way of just normally adding or subtracting array values?