#include <stdio.h>
#include <stdlib.h>
main()
{
FILE *f1;
char ligne[200],nom[256];
printf("donnez le nom de fichier :");
scanf("%s",&nom);
f1=fopen(nom,"r");
if (f1==NULL)
printf("le fichier introuvable\n");
else
{
while (!feof(f1))
{
fgets(ligne,200,f1);
if(!feof(f1))
printf("%s",ligne);
}
fclose(f1);
}
system("pause");
}

0 commentaires :
Enregistrer un commentaire