cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
split in c++
split in c++
Apr 4, 2014 at 2:28pm UTC
angelk
(22)
(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.
Apr 4, 2014 at 2:45pm UTC
mutexe
(2372)
Are you asking a question??
Apr 4, 2014 at 2:53pm UTC
angelk
(22)
I'm wondering how I can do...
Apr 4, 2014 at 3:05pm UTC
Cubbi
(4774)
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
Apr 4, 2014 at 3:06pm UTC
Topic archived. No new replies allowed.