Declaration terminated incorrectly
I am trying to finish up a project on file I/O, and when compiling, I get the error "Declaration Terminated Incorrectly", but it marks the opening braces for one of the functions. What am I doing wrong?
Code follows:
/*
Read input from a file, calculate and print an inventory report,
including items that need to be reordered.
*/
#include <stdio.h>
int GetInvData();
int PrintReport (int *PartNo, float*Price, int *QtyOnHand,int *Reorder,int *MinOrder);
void ReportHeaders();
void PrintHeading();
int main (void)
{
PrintHeading();
ReportHeaders();
GetInvData();
return 0;
}
int GetInvData();
{
FILE *fpInvData;
int PartNo;
float Price;
int QtyOnHand;
int Reorder;
int MinOrder;
fpInvData = fopen("inv.dat","r");
fscanf(fpInvData, "%04d", &PartNo);
fscanf(fpInvData, "%2.2f", &Price);
fscanf(fpInvData, "%4d",&QtyOnHand);
fscanf(fpInvData, "%4d", &Reorder);
fscanf(fpInvData, "%4d", &MinOrder);
while (! feof(fpInvData))
{
PrintReport(int *PartNo, float *Price, int *QtyOnHand, int *Reorder, int *MinOrder);
}
printf("\n\n***End of Report***\n\n");
fclose(fpInvData);
}
Re: Declaration terminated incorrectly
Quote:
Originally posted by Griffin2020
I am trying to finish up a project on file I/O, and when compiling, I get the error "Declaration Terminated Incorrectly", but it marks the opening braces for one of the functions. What am I doing wrong?
Code follows:
/*
Read input from a file, calculate and print an inventory report,
including items that need to be reordered.
*/
#include <stdio.h>
int GetInvData();
int PrintReport (int *PartNo, float*Price, int *QtyOnHand,int *Reorder,int *MinOrder);
void ReportHeaders();
void PrintHeading();
int main (void)
{
PrintHeading();
ReportHeaders();
GetInvData();
return 0;
}
Do you see anything odd about your function call to 'PrintHeading' ... notice anything that isn't there that should be? If you're trying to just prototype, you're doing it wrong there.
Oh, and it could be this line:
Quote:
int GetInvData();
{
FILE *fpInvData;
See that nifty little semicolon? :D :D :D
Quzah.