hi, how can i count the number of a text through a C++ program?
this does not work.
isn't there a command like file_name.eof();?
but for the end of every line? like eol()?? (end of line)
thanks.
hi, how can i count the number of a text through a C++ program?
this does not work.
isn't there a command like file_name.eof();?
but for the end of every line? like eol()?? (end of line)
thanks.
Test for a newline character '\n'.
-Prelude
My best code is written with the delete key.
Well first yoy should open a file in read mode. Then increment a counter till it reached EOF i.e end of file. SO this way you have it. If you want to count the number of wards then find the blank spaces by incrementing the counter when ever " " is got before the EOF this way you get the number of words