Code:
struct tuple
{
char make[50];
char model[50];
char size[50];
char year[50];
char plate[30];
};
void sort(struct tuple * aDB)
{
int j;
FILE *myDB;
system("cls");
myDB = fopen ("cardata.csv", "r");
char sortdata[MAX*5];
for(j=0;j<MAX;j++)
{
char sortdata[(j*5)+0] = aDB->make;
char sortdata[(j*5)+1] = aDB->model;
char sortdata[(j*5)+2] = aDB->size;
char sortdata[(j*5)+3] = aDB->year;
char sortdata[(j*5)+4] = aDB->plate;
aDB++
}
{
fclose (myDB);
for (int k=0;k<MAX;k++)
{
printf("%s", sortdata[k]);
}
getch();
main();
}
Can you please take a look and help me solve this, im trying to sort these so that the program looking into my file, reads whats in there so that it can compare to the next entry and compare a field with that.
i kno i have not put in the swap method but im trying to solve this so that i can move to the next stage.
thank you for your time