How can I determine the number of written lines in a file? Could anyone help? Thanks
This is a discussion on Lines in File within the C++ Programming forums, part of the General Programming Boards category; How can I determine the number of written lines in a file? Could anyone help? Thanks...
How can I determine the number of written lines in a file? Could anyone help? Thanks
Simple:
string str;
ifstream fin(FILE);
int linecount = 0;
while (fin.good()) {
getline(fin,str);
++linecount;
}
That's it.