Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- using namespace std;
- int countline(ifstream& fin) {
- int n = 0;
- string line;
- while(getline(fin, line)) n++;
- return n;
- }
- int main(int argc, char **argv) {
- ifstream fin(argv[1]);
- cout << countline(fin) << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement