Need help on text-based game.

So this is my code so far:



#include "stdafx.h"
#include <cstdlib>
#include <iostream>

int getInput();

void DisplayMainMenu();
void displayCredits();
void creditsMenu();
void startGame();


int main()
{
int choice = 0;

do
{
system("cls");
DisplayMainMenu();
choice = getInput();
switch (choice) {
case 1:
system("cls");
std::cout << "\n Story:\n\n";
std::cout << "You wake up and find yourself in the middle of a forest. You recognize where youare, and realize you are only a couple of miles away from your home. You start \nto walk through the forest towards your house, eager to find out what happened\nto you.";
void startGame();
std::cin.get();
std::cin.ignore();
break;
case 2:
creditsMenu();
break;
case 3:
break;



default:
break;
}
} while (choice != 3);

return 0;

}

int getInput()
{
int choice;
std::cin >> choice;
return choice;
}

void DisplayMainMenu()
{
std::cout << "Main Menu\n" << std::endl;
std::cout << "1 - Start game\n";
std::cout << "2 - Credits\n";
std::cout << "3 - Quit\n" << std::endl;
}

void displayCredits()
{
std::cout << " CREDITS!!!!\n\n\n";
std::cout << "This game was made my SpeedyCuber, AKA Logan Rasher\n";
std::cout << "Check out Void Inc. at void-interactive.net\n";
std::cout << "Thanks for the support!\n\n\n";
std::cout << "Please enter 1 to go back to the Main Menu.\n\n";
}

void creditsMenu()
{
int choice = 0;
do
{
system("cls");
displayCredits();
choice = getInput();

} while (choice != 1);
}

void startGame()
{
std::cout << "\n1. Search your pockets for belongings.\n2. Continue walking in the direction of your home.\n";
std::cin.get();
std::cin.ignore();
}






And my question is: when the user starts the game (typing in 1 to the switch case), it displays the story message, but then won't display the void startGame(). I can't continue this story until thats fixed.
@Hyde40051

Remove the keyword void in front of StartGame().
In the main function that is.
Yeah, I guess I should have specified that part, also.
Topic archived. No new replies allowed.