Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void main(void){
- File *file = fopen("/bibliothek/dokumente/Text.txt","r");
- int counter = -1;
- if(file != NULL){
- char c = 0;
- counter++;
- while((c = fgetc(file))!=EOF)
- if(c=="\n")
- counter++;
- printf("counter: %d",counter);
- }else printf("file ist NULL.\n");
- fclose(file);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement