how come it cant find it...
This is select.h with the menu function:
Code:
#ifndef _SELECT_H
#define _SELECT_H
#include "center.h"
#include "choice.h"
void menu(double winning_amount, double total,double &nettotal)
{
int ch;
time_t t=time(NULL);
cout <<ctime(&t) << endl;
cout << endl;
center("Shopping Spree Program",3);
center("~~~~~~~~~~~~~~~~~~~~~~",4);
cout << endl;
cout << "a.\tComputer Shop" << endl;
cout << "b.\tTotal" << endl;
cout << "c.\tQuit" << endl;
for(/*forever*/;((ch = getch()) != EOF);)
switch(ch)
{
case 'a' :
choicecomp(winning_amount,total,nettotal);
break;
default :
cout << "Bye Bye" << endl;
getch();
break;
}
}
#endif
It says the error in the following section, this is choice.h:
Code:
#ifndef _CHOICE_H
#define _CHOICE_H
#include "select.h"
#include <iostream.h>
#include <conio.h>
#include "center.h"
#include <time.h>
void choicecomp(double winning_amount, double total,double &nettotal)
{
double CompChoice;
do
{
time_t t=time(NULL);
center("Shopping Paradise - Winner's Circle",3);
center("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",4);
cout <<" 1.\tHard Drive" << endl;
cout <<" 2.\tFloppy Disk" << endl;
cout <<" 3.\tCD Burner " << endl;
cout <<" 4.\tBlank CDs " << endl;
cout <<" 5.\tMonitor " << endl;
cout <<" 6.\tSpeakers" << endl;
cout <<" 7.\tVideo Card" << endl;
cout <<" 8.\tGlass Case" << endl;
cout <<" 9.\tWireless Keyboard" << endl;
cout <<"10.\tWireless Mouse " << endl;
cout <<"11.\tComputer Table " << endl;
cout <<"12.\tWindows XP Home " << endl;
cout <<"13.\tMotherboard " << endl;
cout <<"14.\tRogers @Home Starter Kit " << endl;
cout <<"15.\tMicrosoft Works XP" << endl;
cout <<"16.\tBorland C++ v. 6.0" << endl;
cout <<"17.\tRouter" << endl;
cout <<"18.\tNetwork Hub + Ethernet Card" << endl;
cout << endl;
cout <<"What is your choice : ";
cin >> CompChoice;
if(CompChoice == 19)
menu(winning_amount,total,nettotal); <-- It cant find
if(CompChoice == 1)
total = total - 50;
else if(CompChoice == 2)
total = total - 5;
else if(CompChoice == 3)
total = total - 100;
else if(CompChoice == 4)
total = total - 10;
else if(CompChoice == 5)
total = total - 40;
else if(CompChoice == 6)
total = total - 90;
else if(CompChoice == 7)
total = total - 80;
else if(CompChoice == 8)
total = total - 130;
else if(CompChoice == 9)
total = total - 20;
else if(CompChoice == 10)
total = total - 25;
else if(CompChoice == 11)
total = total - 175;
else if(CompChoice == 12)
total = total - 200;
else if(CompChoice == 13)
total = total - 10;
else if(CompChoice == 14)
total = total - 15;
else if(CompChoice == 15)
total = total - 30;
else if(CompChoice == 16)
total = total - 21;
else if(CompChoice == 17)
total = total - 19;
else if(CompChoice == 18)
total = total - 82;
else
cout << "Sorry, That is an Invalid Selection..." << endl;
clrscr();
cout<<total;
}
while(total > 0);
total = nettotal;
}
#endif
I dont understand why it doesn't work... any help would GREATLY be appreciated