okay i see what your saying, and I do already know what order the input is, so that makes it easier...so i have something like this...and it does work
fgets(temp ->head.name,50,ifp);
fgets(temp ->head.foodType,50,ifp);
fgets(temp ->head.servingSize,50,ifp);
fscanf(ifp,"%d",&temp ->head.numOfCals);
fscanf(ifp,"%d",&temp ->head.amountOfSodium);
fscanf(ifp,"%f",&temp ->head.gramsOfFat);
fscanf(ifp,"%d",&temp ->head.gramsOfChol);
fscanf(ifp,"%f",&temp ->head.gramsOfSatFat);
fscanf(ifp,"%d",&temp ->head.gramsOfCarbs);
fscanf(ifp,"%d",&temp ->head.gramsOfSug);
fscanf(ifp,"%d",&temp ->head.gramsOfFib);
fscanf(ifp,"%d",&temp ->head.gramsOfProt);
and the output is(which is correct)
[PHP]
Roasted Turkey Breast
MEAT
3 oz.
160
55
6.000000
65
2.000000
0
0
0
24
[/PHP]
and I'm going to have to have a while loop which keeps creating new nodes until it hits the EOF...but thats another story...so for now....
i have another longer question but I can figure it out myself, if someone could tell me if fscanf() can read in strings? because when i tried to use fscanf for the first three items in the lists which are not ints or floats, but are strings it doesnt work i did something like fscanf("%s",temp -> head.name);
and the output is
[PHP]
RoastedTurkeyBreast0
0
0.000000
0
0.000000
0
0
0
0
[/PHP]
:o
thanks for your help