Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Function for counting lines?

Status
Not open for further replies.

rocki

Technical User
Aug 27, 2002
48
US
Can someone point me in the direction of a function that will count the lines in another cpp file I have?
thx
 
Cmon think about it.....

in pseudocode....
zero counter
open file
read first line (will end in \n)
was read successful?
if yes ++counter
anymore to read?
if yes read next line
if no return counter

not too hard. now u turn that into c++
 
thanks, I can figure the psuedo code - I'm green and trying to learn.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top