I'd aprreciate all your help :)
int reads ()
{
int i= 0, j;
char c;
fp = fopen("dishes.txt", "r");
if (fp != NULL)
{
while (!feof(fp))
{
fscanf (fp,"%50s %50s %f", dish[i].name, dish[i].describe, &dish[i].price);
dishtotal++;
i++;
}//while loop
}//if
// printf ("%d", i);
fclose(fp);
getch();
return;
}
The format of the file looks like this:
string1 string2 price(in float)
sundae chocolate 5.00
lasagna italian 50.00
and so on...
Edited by ZekeDragon, 21 March 2010 - 12:39 AM.
Please use [code] tags (the # button) when posting code.


Sign In
Create Account

Guest_CheapFungus_*
Back to top










