Here is what I have:
// more than one returning value
#include <iostream>
#include <time.h>
#include <string>
using namespace std;
int money = 1000;
string playername;
int currentmenu;
int choice;
void GetName ()
{
cout << "What is your name?\n";
getline(cin, playername);
}
void DisplayMainMenu ()
{
cout << "1.Buy\n2.Sell\n3.Item Shop\n";
cin >> choice;
if (choice == 1)
{
DisplayBuyMenu();
}
}
void DisplayBuyMenu ()
{
cout << "1. Item 1\n2. Item 2\n";
}
int main ()
{
GetName();
DisplayMainMenu();
return 0;
}
The compiler tells me that DisplayBuyMenu() is not declared in this scope. Does anyone know what I am doing wrong? thanks.


Sign In
Create Account


Back to top









