Bonjour
J'ai besoin d'afficher l'historique des achats et des ventes qui se trouvent dans deux fichiers distincts .
Le problème c'est qu'il doit normalement afficher "hello" mais non donc j'ai supposer qu'il n'entre même pas dans la boucle for
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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");
merci d'avance