Best way to get ints from a string with whitespace?

Posted by befall on Stack Overflow See other posts from Stack Overflow or by befall
Published on 2010-04-12T00:08:07Z Indexed on 2010/04/12 0:13 UTC
Read the original article Hit count: 696

Filed under:
|
|

Hey all,

I know this is simple, I just can't recall the best way to do this. I have an input like " 5 15 " that defines the x and y of a 2D vector array. I simply need those two numbers into int col and int row.

What's the best way to do this? I was attemping stringstreams, but can't figure out the correct code.

Thanks for any help!

© Stack Overflow or respective owner

Related posts about c++

Related posts about string