String to Int

Apr 2, 2011 at 7:07pm
Hi, I have an array with string values in there and I would like to transfer them into an int array. The values are Numbers. is there a way to do so?

Thank you
Apr 2, 2011 at 7:26pm
nvm, figured it out using atoi
thanks anyways
Apr 2, 2011 at 8:59pm
Use stringsteam. I'm pretty sure stringstream is a lot better than atoi!
Apr 2, 2011 at 9:21pm
Well, it certainly is if the OP actually means string when he says string.

To use atoi, it'd have to be atoi(str.cstr()), which isnt a very nice command.
Apr 2, 2011 at 9:34pm
Yeah, I had that problem before, when using strings. stringstream is a much better and a much easier way to do things!
Topic archived. No new replies allowed.