I have been working on the following piece of code; It opens an inputfile, reads the input, and now I wish to take that input (stored in a string) and split it by whitespaces; inputting each element into an integer vector.
I understand how to typecast. The problem is in the splitting. How do I do this efficiently? I would like to use a while loop or for loop except I am unable to index the string. I converted the string to constant char so I could index it but now I am unable to compare the value at a point in the string to the expression " " in my if statement. What should I do?