1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| void lire(ptrP p ,ptrC q)
{
while(p!=NULL)
{
printf("\n Paquet %d \n ",p->Numpa);
q=p->pcmd;
while(q!=NULL)
{ printf(" Commande %d ",q->Numcom);
printf("%s ",q->Ncom);
//puts(q->Ncom);
printf("%d \n",q->Pcom);
q=q->cmdsuiv;
}
p=p->pqsuiv;
}
}
void remplirf(ptrP p ,ptrC q)
{
//printf("\nggg\n");
// resultat de type FILE déclarée globale :)
resultat= fopen("D:\resultat.txt","wt");
//printf("\nggg1\n");
while(p!=NULL)
{ //printf("\nggg2\n");
fprintf(resultat,"\n Paquet %d \n ",p->Numpa);
q=p->pcmd;
while(q!=NULL)
{ //printf("zkima");
fprintf(resultat," Commande %d ",q->Numcom);
fprintf(resultat,"%s ",q->Ncom);
//puts(q->Ncom);
fprintf(resultat,"%d \n",q->Pcom);
q=q->cmdsuiv;
}
p=p->pqsuiv;
//printf("Fichier Traite");
}
fclose(resultat);
//printf("Fichier Ferme");
} |
Partager