Annulation.

master
Yann CHAMPEAU 3 years ago
parent 93d30ba621
commit da30f42b7a

@ -20,18 +20,19 @@ void menu(void){
printf("Choisissez votre session : "); printf("Choisissez votre session : ");
} }
VilleIUT** loadIUT(VilleIUT** tiut, int* tlogi){ int loadIUT(VilleIUT** tiut){
FILE* f=fopen("Etudiants.bin","rb"); FILE* f=fopen("Etudiants.bin","rb");
if(f==NULL){ if(f==NULL){
perror("fopen"); perror("fopen");
exit(errno); exit(errno);
} }
MaillonDep* m; MaillonDep* m;
fread(tlogi,sizeof(int),1,f); int tlogi;
for(int i=0; i<*tlogi; i++){ fread(&tlogi,sizeof(int),1,f);
for(int i=0; i<tlogi; i++){
fread(tiut[i]->Ville,sizeof(char),31,f); fread(tiut[i]->Ville,sizeof(char),31,f);
} }
for(int i=0; i<*tlogi; i++){ for(int i=0; i<tlogi; i++){
int nbIUTs; int nbIUTs;
fread(&nbIUTs,sizeof(int),1,f); fread(&nbIUTs,sizeof(int),1,f);
if(nbIUTs){ if(nbIUTs){
@ -56,7 +57,7 @@ VilleIUT** loadIUT(VilleIUT** tiut, int* tlogi){
} }
} }
} }
return tiut[0]; return tlogi;
} }
void saveIUT(VilleIUT** tiut, int tlogi){ void saveIUT(VilleIUT** tiut, int tlogi){

@ -29,7 +29,7 @@ typedef struct file* File; // //
// //
void menu(void); // void menu(void); //
// //
VilleIUT** loadIUT(VilleIUT** tiut, int* tlogi); // int loadIUT(VilleIUT** tiut); //
// //
void saveIUT(VilleIUT** tiut, int tlogi); // void saveIUT(VilleIUT** tiut, int tlogi); //
// //

@ -11,8 +11,7 @@ int main(void)
{ {
system("clear"); system("clear");
VilleIUT* tiut[36529]; VilleIUT* tiut[36529];
int tlogi, quitter=0; int tlogi=loadIUT(tiut), quitter=0;
tiut=loadIUT(tiut,&tlogi);
while(!quitter){ while(!quitter){
menu(); menu();
char user; char user;

Loading…
Cancel
Save