Reading. Practice. Writing.
Please feel free to comment. Suggestions are also welcomed here. Write something "wholesome serving purpose" here.
Monday
C++ using Boost Library: How do I tokenize words from a string in C++?
C++ using Boost Library: How do I tokenize words from a string in C++?
Source Code:
#include <boost/algorithm/string.hpp>
vector<string> vec_str;
boost::split(vec_str, "word0 word1 word2", boost::is_space());
for(size_t i=0; i<vec_str.size(); ++i)
{
cout << "vec_str[" << i << "] = " << vec_str[i] << endl;
}
Output:
vec_str[0] = word0
vec_str[1] = word1
vec_str[2] = word2
Subscribe to:
Post Comments (Atom)
Measure execution time with Julia, example using sorting algorithms
# random integers between 1 and 100 inclusive, generate thousands of them x = rand ( 1 : 100 , 100000 ) @time sort (x; alg=InsertionSort, r...
-
Open LibreOffice Draw program. Select the rectangle shape from shape toolbar at the bottom of drawing page. Click a point and drag-and-re...
-
DiGi Super Long Life is a feature where you can extend your talktime validity to 1 year for just RM38. Indirectly, the subscription fee is ...
-
DiGi Super Long Life is a feature where you can extend your talktime validity to 1 year for just RM30. Indirectly, the subscription fee is...
No comments:
Post a Comment