c++ - Counting columns of a space separated file -
I need to use I currently use something like this: What do I want? Edit: I mean, if the data like No, you will calculate the space, not the column. You have to do your line to Tokunize, eg. By std :: count (or any other appropriate work) in my question Is the column of files different from any location
std :: ifstream infix ("file"); Int lines = std :: count (std :: istreambuf_iterator & lt; char> (inFile), std :: istreambuf_iterator & lt; char & gt; (), '\ n');
std :: ifstream infix ("file"); Int columns = std :: count (std :: istreambuf_iterator & lt; char> (inFile), std :: istreambuf_iterator & lt; char & gt; ('\ n'), '') + 1;
"in file" is
1 2 or
1 [many spaces here] 2 , anyway
column should be 2 or 2 anyway?
Comments
Post a Comment