update
This commit is contained in:
21
DEV.1.1/Fichiers/lecture-ficher/openfile-fgets.c
Normal file
21
DEV.1.1/Fichiers/lecture-ficher/openfile-fgets.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void){
|
||||
FILE *fic = fopen("text.txt", "r");
|
||||
char lettre[256];
|
||||
|
||||
if(fic == NULL){
|
||||
exit(1);
|
||||
}
|
||||
|
||||
while(fgets(lettre, 255, fic) != NULL){
|
||||
printf("%s", lettre);
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
fclose(fic);
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user