c++ - Delimiter extracting out a range of data -


from textfile(range.txt),

range:1:2:3:4:5:6....:n: 

there's list of result, need extract digit 1 2 3 last digit, last digit may varies

so read in file, extract out delimiter , push vector.

ifstream myfile; myfile.open("range.txt");  istringstream range(temp); getline(range, line,':');  test.push_back(line); 

how capture value? have , capture 1 digit.

i have , capture 1 digit

you need use loop :-

while (getline(range, line, ':'))    test.push_back(line); 

later using vector can process integers only.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -