Programming

(C++) How do I tokenize a string in C++?

steloflute 2013. 1. 28. 23:30

http://stackoverflow.com/questions/53849/how-do-i-tokenize-a-string-in-c

 

Another quick way is to use getline. Something like:

stringstream ss("bla bla");
string s;

while (getline(ss, s, ' ')) {
 cout << s << endl;
}