1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| #include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
FILE *fichier1,*fichier2;
int matricule;
char nom[10],prenom[10];
/*ouverture des fichiers*/
fichier1=fopen("c:\\fichierC.txt","r");
fichier2=fopen("c:\\fichierC2.txt","w");
while(!feof(fichier1)){
fscanf(fichier1,"%i %s %s",&matricule,nom,prenom);
fprintf(fichier2,"%i %s %s \n",matricule,nom,prenom);
}
/*fermeture des fichiers*/
fclose(fichier1);
fclose(fichier2);
system("PAUSE");
return 0;
} |
Partager