string fileName(filepath); ifstream inData; inData.open(fileName.c_str()); if (!inData) return 0; int size = 0; while (inData.good()) { inData.getline(temp, 4096, ','); size++; } 

size == 40 , although the file has only 18 lines. How?

  • one
    code is super and question is super - Gorets

1 answer 1

So you have the same limiter ',' comma. So you read and count the pieces between the commas.

  • yes already entered, that I blunted. - PaulD
  • ATP all the same - PaulD