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
|
tp=fopen("table24.txt","r");
fseek(rp,0,2);
nb_enrg=ftell(tp)/25;
fseek(tp,0,0);
printf("entrez le code");
scanf("%s",y->code);
for(i=0;i<nb_enrg;i++)
{
printf("hello");
fread(&s,3,1,tp);
if(strcmp(s,y->code)==0)
{
printf("%c %d %d" ,y->code,y->datea,y->qta,y->prixa);
R=1;
}}
if(R==-1)
printf("ce nom n'existe pas");
rp=fopen("table25.txt","r");
fseek(rp,0,2);
nb_enrg2=ftell(rp)/sizeof(struct table2);
fseek( rp,0,0);
for(i=0;i<nb_enrg2;i++)
{ printf("hello");
fread(&s,3,1,rp);
if(strcmp(s,g->code)==0){
printf("%c %d %d" ,g->code,g->datev,g->qtv,g->prixv);
R=1;
}}
if(R==-1)
printf("ce nom n'existe pas"); |
Partager