M
mdh
Can someone enlighten me?
let "s" be a string array and "i, n" be an integers.
Why does the expression:
s= n % 10 + '0' put the "string value" of the modulo in the array.
I thought by placing the 0 in a single quote, you are telling the
compiler to treat 0 as a character.
I fail to see how "n % 10" added to that produces the correct result,
which it does!
Thanks in advance.
Ref to this is page 64 of K&R(2);
let "s" be a string array and "i, n" be an integers.
Why does the expression:
s= n % 10 + '0' put the "string value" of the modulo in the array.
I thought by placing the 0 in a single quote, you are telling the
compiler to treat 0 as a character.
I fail to see how "n % 10" added to that produces the correct result,
which it does!
Thanks in advance.
Ref to this is page 64 of K&R(2);