Advertisement
Guest User

bfx counter cpp source

a guest
Mar 31st, 2010
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8.     cout<<"Ziehe die Datei hier rein / Dateipfad angeben... :"<<endl;
  9.     char filename[255];
  10.     cin.getline(filename,255);
  11.     FILE *datei = fopen(filename,"r");
  12.     int lines = 1;
  13.     if(!datei)return 1;
  14.     int chx;
  15.     do
  16.     {
  17.         chx = fgetc(datei);
  18.         if(chx == 10)lines++;
  19.     }
  20.     while(chx != EOF);
  21.     cout<<"Linien : " << lines <<endl;
  22.     getchar();
  23.     return EXIT_SUCCESS;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement