Error: Declaration Syntax error on function input
Note: using turbo c++ 4.5 compiler
#include "iostream.h"
#include "conio.h"
#include "stdlib.h"
#include "cstring.h"
#include "fstream.h"
#include "time.h"
#include "stdio.h"
time_t now=time(0);char*dt=ctime(&now);
int ch,dn=0;
struct BuyerInfo
{
char id[5];
string fn;
string mn;
string ln;
string ad;
}
info[100];
struct grocery
{
char barcode[5];
string prodname;
string category;
float price;
} ;
void inputs()
{
cout<< "\n================================================================================";
cout<< "\t\t\n\t\t Please fill in the following required information\n";
cout<< "\n================================================================================";
char ans='y';
while (ans=='y'||ans=='Y')
{
cout<< "\nBuyer's ID:B";
for(dn=0;dn<1;dn++)
{
cin>>info[dn].id;
}
strcat(info[dn].id,".docx");
FILE * pFile;
pFile=fopen (info[dn].id,"rb");
if(pFile!=NULL)
{
cout<<" ID NUMBER IS IN USED"<<endl;
cout<<" DO YOU WANT TO ENTER ANOTHER?(Y/N) ";
cin>>ans;
clrscr();
if( ans=='n'||ans=='N')_exit(0);
}
else
{
FILE * mFile;
mFile=fopen (info[dn].id,"w");
fclose (mFile);ans='?';
for(dn=0;dn<1;dn++)
{
cout<< "Enter First Name:";
getline(cin,info[dn].fn);
cout<< "Enter Middle Name:";
getline(cin,info[dn].mn);
cout<< "Enter Last Name:";
getline(cin,info[dn].ln);
cout<< "Enter Address:";
getline(cin,info[dn].ad);
gotoxy(2,11);
cout<<"Date: "<<dt;
}
}
}
void mainscreen()
{
cout<< "\n================================================================================";
cout<< "\t\t\t VONGOLA POINT OF SALE SYSTEM";
cout<< "\n================================================================================";
cout<< "\nPlease choose from the following:";
cout<< "\n[1]Scan Buyer's Items";
cout<< "\n[2]Additional Items";
cout<< "\n[3]Cancel Items";
cout<< "\n[4]Searching for Buyer's Record";
cout<< "\n[5]Deleting Buyer's Record";
cout<< "\n[6]Show all Products available in the Grocery Store";
cout<< "\n[7]Show Products based on Product Category";
cout<< "\n[8]Exit";
cout<< "\n================================================================================";
cout<< "\nOption:";
cin>>ch;
}
int main()
{
grocery data[50];
ifstream in;
in.open("grocery.txt");
for(int i = 0;i<50; i++)
{
in >>data[i].barcode >> data[i].prodname >> data[i].category >> data[i].price;
}
in.close();
}
return 0;
inputs();
clrscr();
mainscreen();
switch(ch)
{
case '1':break;
case '2':break;
case '3':break;
case '4':break;
case '5':break;
case '6':break;
case '7':break;
case '8':break;
default:_exit(0);
}
}