I haven't finished my program yet, but the errors say, "local function definitions are illegal" for my functions...I don't know what to do, does anyone have any suggestions? Thanks
int main()
{
int numAdults, numChildren;
double childMeal, adultMeal;
char type;
char weekend;
ifstream infile;
ofstream outfile;
infile.open("C:\\TEMP\\cateringdata.txt");
if(!infile)
{cout<<"File not found."<<endl;
outfile<<"Program terminates.";
exit(1);
}
outfile.open("C:\\TEMP\\outCatering.txt");
while(!infile.eof())
{
infile>>numAdults>>numChildren;
if( numAdults && numChildren <=0)
{outfile<<"# of Adults : Number of guests is invalid."<<endl;
outfile<<" # of Children: Number of guests is invalid."<<endl;}
else
outfile<<"# of Adults :"<<numAdults<<endl;
outfile<<"# of Children:"<<numChildren<<endl;
infile>>type;