#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)
-
* Introduction - The solution shows panorama image from multi images. The panorama images is processing by real-time stitching algorithm...
-
As you can see in the following video, I created a class that stitching n cameras in real time. https://www.youtube.com/user/feelmare/sear...
-
Image size of origin is 320*240. Processing time is 30.96 second took. The result of stitching The resul...
-
This is example code for drawing fan shape grid using vtkStructuredGrid in vtk. I've looked at a lot of examples that draw like thi...
-
In past, I wrote an articel about YUV 444, 422, 411 introduction and yuv <-> rgb converting example code. refer to this page -> ht...
-
The latent SVM tells the learning method used in this paper -> "Discriminatively trained deformable part models". The authors s...
-
put a explicit parameter name like: from sklearn.utils import class_weight class_weights = class_weight.compute_class_weight( class_weight...
-
refer to code: - x = 0.003 formatted_x = " {:.1e} " . format ( x ) print ( formatted_x ) # Output will be "3.0e-03"...
-
refer to code: . # pip install pyheif pillow # brew install libheif import os import subprocess input_folder = "./input/path"...
No comments:
Post a Comment