Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- using namespace std;
- int main(int argc, char *argv[])
- {
- cout<<"Ziehe die Datei hier rein / Dateipfad angeben... :"<<endl;
- char filename[255];
- cin.getline(filename,255);
- FILE *datei = fopen(filename,"r");
- int lines = 1;
- if(!datei)return 1;
- int chx;
- do
- {
- chx = fgetc(datei);
- if(chx == 10)lines++;
- }
- while(chx != EOF);
- cout<<"Linien : " << lines <<endl;
- getchar();
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement