#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)
-
This is data acquisition source code of LMS511(SICK co.) Source code is made by MFC(vs 2008). The sensor is communicated by TCP/IP. ...
-
Image size of origin is 320*240. Processing time is 30.96 second took. The result of stitching The resul...
-
The MNIST dataset is a dataset of handwritten digits, comprising 60 000 training examples and 10 000 test examples. The dataset can be downl...
-
Background subtractor example souce code. OpenCV support about 3 types subtraction algorithm. Those are MOG, MOG2, GMG algorithms. Det...
-
OpenCV has AdaBoost algorithm function. And gpu version also is provided. For using detection, we prepare the trained xml file. Although...
-
Refer to this page about official reference of ICF http://docs.opencv.org/3.0.0/d6/dc8/classcv_1_1xobjdetect_1_1ICFDetector.html Other pa...
-
Created Date : 2011.2 Language : C/C++ Tool : Microsoft Visual C++ 2010 Library & Utilized : OpenCV 2.2 Reference : Interent Refer...
-
Created Date : 2009.10. Language : C++ Tool : Visual Studio C++ 2008 Library & Utilized : Point Grey-FlyCapture, Triclops, OpenCV...
-
Contents What is a D-U-N-S Number? Prerequisites — Documents to Prepare Go to the D&B Application ...
-
This is advanced from " http://feelmare.blogspot.kr/2011/08/camera-calibration-using-pattern-image.html " When you run the c...

No comments:
Post a Comment