split in c++

(5,4) (1,01) (10,110) (29,13) (15,29) (19,22)
(520,20) (91,41) (15,29) (20,1)

Hello everyone, I have this sequence of strings. I would take the whole line eg. (5.4) (1.01) (10.110) (29.13) (15.29) (19.22).
Store in an array of strings each pair, such as: (5.4) and then work on them. This is a file for reading.
Are you asking a question??
I'm wondering how I can do...
You could parse straight into a vector of pairs of integers with boost.spirit, but just to split a string into whitespace-separated substrings, you have a LOT of options: http://stackoverflow.com/questions/236129/how-to-split-a-string-in-c http://stackoverflow.com/questions/53849/how-do-i-tokenize-a-string-in-c
Last edited on
Topic archived. No new replies allowed.