Making one structure....Ok
Making an array of structures....I'm stuck
DataFile:
Code:
Sony 29" TV
699.99
5
N/A
Electronic
Flat Screen WEGA
Sony DVD Player
400.5
11
N/A
Electronic
Proressive Scan
Load data to structure:
Code:
void loadData(structure *inventory,FILE *dataFile)
{
fgets(inventory->name, MAXchar,dataFile);
fgets(inventory->price, MAXchar,dataFile);
fgets(inventory->noofItems, MAXchar,dataFile);
fgets(inventory->expiry, MAXchar,dataFile);
fgets(inventory->type, MAXchar,dataFile);
fgets(inventory->detail, MAXchar,dataFile);
}
Print to Screen:
Code:
puts(inventory.name);
puts(inventory.price);
puts(inventory.noofItems);
puts(inventory.expiry);
puts(inventory.type);
puts(inventory.detail);
Now how do i convert this so i can take in the two sets of data..?
Any help would be appreciated.