So many errors already. Here's a few that I've spotted:
Code:
if((ptr_bagel= fopen("Bagel.seq","r"))==NULL)
{
printf("\a\afile could not be opened\n");
}
if((ptr_report=fopen("report.rpt","w"))==NULL)
{
printf("\a\aFile could not be opened\n");
}
The program should probably exit if it fails to open the files.
Code:
while(!feof(ptr_bagel && ptr_report)
Other than the fact that the syntax is wrong, you only need to run the loop until ptr_bagel reaches the end of the file. I could be wrong, but I don't think ptr_report can ever reach the end of the file because you're constantly writing to it.
Code:
fprintf(ptr_report,"%d%s%d%d",&report.srore no,report. bagel description, report.bagel price, report. no sold)
You're printing a whole bunch of data that hasn't had any values set to it. This will end up printing garbage data to your file.
Also, %s is for strings. In your struct, "bagel description" is a char. If you want "bagel description" to be a string, then you need to make it a char * or if you don't know about pointers, a char array.
Code:
char bagel description
double bagel price
int no. sold
Variables can't have spaces in their names. So for instance, you could change "bagel description" to just "description" or "bagel_description" or "bagelDescription".