I have 3 structures for which information is entered by the user and stored in a .bin file
Code:
struct date{ int day, month, year;
};
struct detail{
float quantity;
struct date expdate;
};
struct item{
int itemID;
char name[20], measure[10], lowestamt[10], status[10];
struct detail q[10];
};
struct item Ingredient;
In the struct "Ingredient", I have an array struct "q" which can store up to 10 elements. In the program, only one element of the array q would be filled at any one time and I'd like the user to be able to edit the item record and add information to the next element in the array q. So if q[x] is filled, I'd like to add information to q[x+1]. My question is, how do I find out what the value of x is for each item record in the file?