I am coding Quicksort to sort binary files that contains different data type(structs). This is what i wrote so far:
void quicksort(){
int izbor;
char naziv_datoteke[20];
cout << "Izaberite datoteku koju zelite sortirati: "<<endl;
cout << "1 - sifra.ind "<<endl;
cout << "2 - ime.ind "<<endl;
cout << "3 - prezime.ind "<<endl;
cin >>izbor;
switch(izbor){
case 1:strcpy(naziv_datoteke, "sifra.ind");
typedef tsifra slog;
break;
case 2:strcpy(naziv_datoteke, "ime.ind");
typedef time slog;
break;
case 3:strcpy(naziv_datoteke, "prezime.ind");
typedef tprezime slog;
break;
}
int broj_zapisa;
dat.open(naziv_datoteke, ios::in|ios::out|ios::binary);
dat.seekg(0, ios::end);
broj_zapisa=dat.tellg()/sizeof(slog);
// quicksort(0, broj_zapisa-1);
dat.close();
}
I am getting this error:
conflicting declaration 'typedef struct time slog'
I would like to define slog as data type that is stored in file so I can use it later for getting the size of that struct and few other things.