An element of a string is of type 'char'. As you have found outWow. That works. I do not fully understand why it works, but I wanted to
already, the value is controlled by the encoding of the symbol.
If you want to convert a char that supposedly contains a decimal
digit into its corresponding number, you need to (a) test to see
that it's actually a digit (see 'isdigit' function) and (b) if it
is a digit, subtract '0' from it:
if (isdigit(*rit))
cout << position << (*rit - '0') * 2 << endl;
else
cerr << position << " - not a digit!!!" << endl;
> position++;
}
}
V
thank you for the advice. I'll research it more until I better understand.
Brad