I'm trying to write inside a file the whole content of an array. Here is my code:
fichier = fopen(patch, "w+");
if (fichier != NULL)
{
if(methode==1)
{
trieur(tableau, ttableau);
int d;
d=0;
for (d = 0 ; d < ttableau ; d++)
{
fputs(tableau[d], fichier);
}
}
else if(methode==2)
{
trieur2(tableau, ttableau);
int d;
d=0;
for (d = 0 ; d < ttableau ; d++)
{
fputs(tableau[d], fichier);
}
}
else
{
printf("Methode non disponible!\nBye Bye!");
exit(0);
}
do
{
caractere = fgetc(fichier);
printf("%c", caractere);
} while (caractere != EOF);
fclose(fichier);
}
else
{
printf("Hum something wrong witch file %s", name);
}
But it isn't working. Can anyone help me?
Thanks!
ps: More script, all is working normally, but my script shutting down when he should write on the file :/
main => pastebin.com/m2AM0080 func.h => pastebin.com/KQkAbwin