#include < iostream > #include < string > #include < sstream > using namespace std; vector< string> str_split(const string &s, char delim) { vector< string> elems; stringstream ss(s); string item; while (getline(ss, item, delim)) { elems.push_back(item); } return elems; } int main() { vector< string> str = str_split( "123,456", ','); for(int i=0; i< str.size(); ++i) { printf("%s\n", str[i].c_str() ); } }
3/11/2014
C,C++, string split example source code (stringstream, getline functions)
Subscribe to:
Post Comments (Atom)
-
Logistic Classifier The logistic classifier is similar to equation of the plane. W is weight vector, X is input vector and y is output...
-
//Singular value decomposition : Mat w, u, v; SVDecomp(data, w, u, v); // A = U W V^T //The flags cause U and V to be returned transpose...
-
In past, I wrote an articel about YUV 444, 422, 411 introduction and yuv rgb converting example code. refer to this page -> http://feel...
-
dp parameter is about resolution of voting space. dp is larger, voting resolution is small compare to image size. so dp is larger, circle...
-
Optical Flow sample source code using OpenCV. It programed based on http://feelmare.blogspot.kr/2012/10/make-2-frame-having-time-interv...
-
line, circle, rectangle, ellipse, polyline, fillConvexPoly, putText, drawContours example source code!!. ... //http://study....
-
recent EEG datasets and papers from the last 5 years: OpenNeuro EEG Datasets (2020-Present) DS003190: High-density EEG during motor tasks (...
-
What is TorchOps.cpp.inc ? TorchOps.cpp.inc : This file contains implementations of the operations for the torch-mlir dialect. It is ty...
-
I can know all coordinate from A point to B point using "LineIterator" function in OpenCV. So this source code is applied by this...
-
TensorFlow install using virtualenv on ubuntu environment. The method is same with pip install. http://study.marearts.com/2016/04/tensorf...
No comments:
Post a Comment