Hi Peter:
From the code you posted here on the 7th, I found a couple things wrong with your mainmenu function. I have pointed them out here (see capital comments):
void mainmenu(int num); //SEMI-COLAN SHOULD NOT BE HERE
{
char choice;
cout << "Enter 1, 2, 3 or 4: ";
cin >> choice;
switch (choice)
{
case '1': cout << "You have entered Cashier Module.\n";
{
// Call displayValue with argument 5
cout << "Now I am back in main.\n";
}
break;
case '2': cout << "You have entered Inventory Database Module.\n";
break;
case '3': cout << "You have entered Report Module.\n";
break;
case '4': cout << "You have entered Exit.\n";
break;
default: cout << "You did not enter 1, 2, 3, or 4!\n";
}
return 0; //SHOULD NOT RETURN AN INT. SHOULD EITHER SAY 'return;' OR SHOULD BE REMOVED
}
You can see here, that the problem lies with the first line ( void mainmenu(int num); ), and the second to last line ( return 0; ). The problem exists with the first line, because you are defining the function, but cutting it off immediately (the semi-colan does this). This is an honest mistake, however - you probably cut and pasted the prototype from the top of the program, but forgot to remove the semi-colan :o
A problem exists with the second to last line, because you are trying to return an int, when it should be returning nothing (void). So, to fix this, you could completely remove this line or change it to simply say: return;
Other than that, I believe everything else looked fine. My computer was having a hissy fit with the '#include "stdafx.h"' include at the top, but i was able to omit that and still get the program to compile fine.
Let me know if these fixes work for you. Good luck with your class!
-Babbage