read file OK

This commit is contained in:
2023-02-16 12:45:14 +01:00
commit e63380461d
2 changed files with 81 additions and 0 deletions

16
TP1/read_file/main.c Normal file
View File

@@ -0,0 +1,16 @@
#include <stdio.h>
int main() {
FILE *pFile;
char c;
if(pFile = fopen("fichier.html", "rt")) {
for(c = fgetc(pFile); !feof(pFile); c = fgetc(pFile)) {
printf("%c", c);
}
fclose(pFile);
} else {
printf("error");
}
return 0;
}