// pouvez vous me dire pourquoi le fprintf ne marche pas svp . //
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
35
36
37 #include<stdio.h> #include<stdlib.h> main() { int i,eng; FILE*etudiants=NULL; etudiants= fopen ("etudiant.txt","w"); printf("entre le nbr d'enregistrement svp :"); scanf("%d",&eng); struct etd { int matricule; char nom[30]; char prenom[20]; int moy; }; struct etd l[eng]; for(i=0;i<eng;i++) { scanf ("%s",&l[i].nom); fprintf(etudiants,"%s"); scanf ("%s",&l[i].prenom); fprintf(etudiants,"%s"); scanf ("%s",&l[i].matricule); fprintf(etudiants,"%s"); scanf("%d",&l[i].moy); fprintf(etudiants,"%d"); } fclose(etudiants); }
Partager