For standard i know it can be save and load by this way :
Code:
struct record {
char name[20];
float height;
float weight;
};
struct record Rec;
Code:
/* save into file */
fwrite(&Rec, sizeof(struct record), 1, fptr1);
Code:
fread(&Rec, sizeof(Rec), 1, fptr1);
while (!feof(fptr1)) {
printf("%s", Rec.name);
printf("%f", Rec.height);
printf("%f", Rec.weight);
printf("\n");
/* read next record */
fread(&Rec, sizeof(Rec), 1, fptr1);
But when the structure contain of array, i dunno how to do it :/
Code:
struct record {
char name[20];
float height;
float weight;
};
struct record RecArray[1000];