Advertisement
helenrut

Untitled

Sep 11th, 2015
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. int count_lines (ifstream& thefilename)
  2. {
  3. char (y);
  4. int counter = 0 ;
  5.  
  6. while (!thefilename.eof()) {
  7. thefilename.get(y);
  8. if (y == '\n'){
  9. counter = counter ++ ;
  10. }
  11.  
  12. }
  13. if y! = '\n'{
  14. counter = counter ++ ;
  15. }
  16.  
  17. return 0;
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement