Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. unsigned int calcLineCount ( std :: istream & is)
  2. {
  3. unsigned int lineCount = 0;
  4. std :: string line ;
  5. while ( std :: getline (is , line ))
  6. ++ lineCount ;
  7. return lineCount ;
  8. }
  9. int main ( int argv , char ** argc )
  10. {
  11. std :: vector < std :: string > arguments (argc , argc + argv );
  12. std :: ifstream fs( arguments [1]) ;
  13. std :: cout << calcLineCount (fs) << "\n";
  14. return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement