Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- void line(FILE *f, char *s) {
- while((*s=fgetc(f))!='\n' && *s!=EOF) s++;
- *s='\0';
- }
- int main() {
- char a[80];
- FILE *fp;
- fp=fopen("szoveg.txt","r");
- if (fp==NULL) {
- printf("FAJLHIBANAL\n");
- system("PAUSE");
- return -1;
- }
- line(fp,a);
- while (!feof(fp)) {
- printf("%s\n",a);
- line(fp,a);
- }
- system("PAUSE");
- fclose(fp);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement