Modification de la fonction loadIUT.

master
Yann CHAMPEAU 3 years ago
parent 93bb8c24e3
commit 21f38dd23b

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

@ -29,11 +29,11 @@ typedef struct file* File; // //
//
void menu(void); //
//
int loadIUT(VilleIUT** tiut); //
VilleIUT** loadIUT(VilleIUT** tiut, int* tlogi); //
//
void saveIUT(VilleIUT** tiut, int tlogi); //
void saveIUT(VilleIUT** tiut, int tlogi); //
//
int rechercheIUT(VilleIUT* tab[],int lTab,char mot[]); //
int rechercheIUT(VilleIUT* tab[],int lTab,char mot[]); //
//
//
//

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

Loading…
Cancel
Save