Voilà du code qui devrait te convenir :
#define TAILLEBUFFER 1024
#define ZERO_FIN 1
static char Texte[TAILLEBUFFER + ZERO_FIN];
static char NomFichierEntree[TAILLEBUFFER + ZERO_FIN];
static char NomFichierSortie[TAILLEBUFFER + ZERO_FIN];
FILE * Fichier = fopen(CheminFichier, "r");
while(fgets(Texte, TAILLEBUFFER, Fichier))
{
i = 0;
while (Texte[i] != ' ') i++;
//1ère ligne
strcpy(NomFichierEntree, Left(Texte, i));
strcpy(NomFichierSortie, Right(Texte, strlen(Texte) - i - 1));
//etc...
}
fclose(Fichier);
char * Left(char * Texte, int Nb_Caract)
{
static char Resultat[] = "";
if (Nb_Caract >= 0 && Nb_Caract <= strlen(Texte) )
{
strncpy (Resultat, Texte, Nb_Caract);
Resultat[Nb_Caract] = '\0';
}
return Resultat;
}
char * Right(char * Texte, int Nb_Caract)
{
static char Resultat[] = "";
int Longueur = strlen(Texte);
if (Nb_Caract >= 0 && Nb_Caract <= Longueur )
{
strncpy(Resultat, Texte + (Longueur - Nb_Caract), Nb_Caract);
Resultat[Nb_Caract] = '\0';
}
return Resultat;
}
Tiens moi au courant.
YOYO, @+.
YOYO 