No, a string or a cstring are containers. Ints and chars are scalars, if you will. You can refer to the i'th character in a string or array of chars using [i] (starting at zero). Those you can cast to ints.
No, a string or a cstring are containers. Ints and chars are scalars, if you will. You can refer to the i'th character in a string or array of chars using [i] (starting at zero). Those you can cast to ints.
Last edited by CodeMonkey; 07-17-2010 at 07:39 PM. Reason: typo
"If you tell the truth, you don't have to remember anything"
-Mark Twain
Yeah, realized that, but I'm using string::at(0) instead of the string [] operator, which will also work:
http://codepad.org/syOCO6Mq
Thanks for the help.
Last edited by Programmer_P; 07-17-2010 at 07:55 PM.
I'm an alien from another world. Planet Earth is only my vacation home, and I'm not liking it.