Langage c
devoinfo
-
chuka Messages postés 965 Date d'inscription Statut Membre Dernière intervention -
chuka Messages postés 965 Date d'inscription Statut Membre Dernière intervention -
salut à tout
svp j'ai un problem dans le code suivant dont le role est de copier les enregistrement qui sont mémoriser dans le fiuchier ancien et les coller dans le fichier nouveau le code que j'ai fais ne fonctionne pas voici mon code SVP répondez moi:
#include <stdio.h>
#include <stdlib.h>
int i;
char nomfich[30],fichenc[30],ancien[30],nouveau[30],nompers[30];
FILE *infile,*outfile;
int main(int argc, char *argv[])
{
do
{
printf(" entrez le ancien fichier\n");
scanf("%s",ancien);
infile=fopen(ancien,"r");
if(!infile)
printf(" impossible d'ouvrire le fichier %s\n,ancien");
}
while(!infile);
do
{printf(" entrez le nouveau fichier\n");
scanf("%s",nouveau);
outfile=fopen(nouveau,"r");
if(!infile)
printf(" impossible d'ouvrire le fichier %s\n",nouveau);
}
while(!outfile);
while(!feof(infile))
{
fscanf(infile,"%s\n",nompers);
fprintf(outfile,"%s\n",nompers);
}
fclose(outfile);
fclose(infile);
system("PAUSE");
return 0;
}
svp j'ai un problem dans le code suivant dont le role est de copier les enregistrement qui sont mémoriser dans le fiuchier ancien et les coller dans le fichier nouveau le code que j'ai fais ne fonctionne pas voici mon code SVP répondez moi:
#include <stdio.h>
#include <stdlib.h>
int i;
char nomfich[30],fichenc[30],ancien[30],nouveau[30],nompers[30];
FILE *infile,*outfile;
int main(int argc, char *argv[])
{
do
{
printf(" entrez le ancien fichier\n");
scanf("%s",ancien);
infile=fopen(ancien,"r");
if(!infile)
printf(" impossible d'ouvrire le fichier %s\n,ancien");
}
while(!infile);
do
{printf(" entrez le nouveau fichier\n");
scanf("%s",nouveau);
outfile=fopen(nouveau,"r");
if(!infile)
printf(" impossible d'ouvrire le fichier %s\n",nouveau);
}
while(!outfile);
while(!feof(infile))
{
fscanf(infile,"%s\n",nompers);
fprintf(outfile,"%s\n",nompers);
}
fclose(outfile);
fclose(infile);
system("PAUSE");
return 0;
}
A voir également:
- Langage c
- Langage ascii - Guide
- Langage binaire - Guide
- Pascal langage - Télécharger - Édition & Programmation
- Langage visual basic - Télécharger - Langages
- Langage basic gratuit - Télécharger - Édition & Programmation