Ok, well I got the menu set up and when the user enters a option it displays the string. Then I want the menu to reapear again so they may choose another option but i keep getting the press any key to continue comand.
Code:
#include <stdlib.h>
#include <iostream>
#include <string>
#include <conio.h>
#include <windows.h>
using namespace std;
void overview();
void races();
void world();
void menu();
int main()
{
char name[50];
int input;
cout << " Welcome to my test Proggy!" << endl;
Sleep(1000);
cout << " What is your name?" << endl;
cin.getline(name, 50, '\n');
cout << " Hello " << name;
Sleep(2000);
cout << endl << " Please choose one of the options below ";
cout << endl;
cout << " 1. Overview " << endl;
cout << " 2. Races." << endl;
cout << " 3. World." << endl;
cin >> input;
switch (input)
{
case 1: overview ();
break;
case 2: races ();
break;
case 3: world ();
break;
default:
cout<<"Error, bad input, quitting";
}
void menu();
system("pause");
return 0;
}
void overview()
{
cout << " An Overview of DragonWars:" << endl;
cout << " DragonWars (Not official) is a MultiPlayer RPG where" << endl;
cout << " the player can choose between four Races: Draconians," << endl;
cout << " Humans, Elves and Drow. The abyssal forces (Deamons)" << endl;
cout << " are approching over the lands and upsetting the" << endl;
cout << " balance between good and evil. The Draconians are" << endl;
cout << " at a constant war with the abyssal forces to protect" << endl;
cout << " their homelands which border the portals between " << endl;
cout << " the two planes of exsistence. The elves are fighting" << endl;
cout << " thier own battles with the drows and the abyssal" << endl;
cout << " forces are slowly advancing to their homes. The human" << endl;
cout << " race have been corupted by the abyssal forces and have" << endl;
cout << " grown week. The Drows are at constant war with the" << endl;
cout << " Elves and although they are evil they do not support" << endl;
cout << " the Abyssal forces. Where as many individuals seek" << endl;
cout << " thir own paths and adventures weather it be for sake" << endl;
cout << " of their race's future or their personal gain. The" << endl;
cout << " play can choose from several diffrent classes such as" << endl;
cout << " Mages, Thaums, Wariors, Archers and crafters." << endl;
}
void races()
{
cout << " An Overview of the races";
}
void world()
{
cout << " An Overview of the World";
}
void menu()
{
int input;
cout << " Please Choose one of the following:";
cout << endl;
cout << " 1. Overview " << endl;
cout << " 2. Races." << endl;
cout << " 3. World." << endl;
cin >> input;
switch (input)
{
case 1: overview ();
break;
case 2: races ();
break;
case 3: world ();
break;
default:
cout << " Error, bad input, quitting";
}
}