/* This is an example of reading characters from a file */ #include <stdio.h> void main() { FILE *funny; char c; funny = fopen("TENLINES.TXT","r"); if (funny == NULL) printf("File doesn't exist\n"); else { do { c = getc(funny); /* get one character from the file */ putchar(c); /* display it on the monitor */ } while (c != EOF); /* repeat until EOF (end of file) */ } fclose(funny); }READCHAR.C |
Κατεβάστε το πρόγραμμα στον υπολογιστή σας |