Code:
void weekly_prices(FILE*fPtr)
{
system("cls");
struct cropprices price={0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
char fname[128];
printf("Enter the file name: \n");
scanf("%123s",fname);
strcat(fname,".txt");
FILE *inputf
this is the start of one function.
Code:
void newOrder(FILE*fPtr)
{
system("cls");
struct cusInfo cus={0,"","","","",};
char fname[128];
printf("Enter the file name: \n");
scanf("%123s",fname);
strcat(fname,".txt");
FILE *inputf;
fPtr=fopen("fname","r");
if (fPtr==NULL){
printf("Error opening source file\n");
}
fscanf(fPtr,"%.2f\n",price.pumpkinsp);
thats how i did it, but in the new order function it is telling me that price was not delcared. how do i pass the file name or pointer?