Hello all,
I am new to c++. Please help with the following.
I have two strings, viz., "0, 1, 3, 2" and "-1, -1, 1, 1, 1, -1, -1, 1". I need to convert them to a vector of integers, viz., unsigint.at(0) = 0, ..., unsignint.at(3) = 2, and
signint.at(0) = -1, ..., signint.at(7) = 1.
Any ideas?
Thanks in advance.
There are, of course, a ton of ways to do this. You can just write your own using getline (to tokenize by comma) and a stringstream and extraction operator (to read the numbers).