0

I want to let players press any key to continue with the game, but don't know how. Here is the code I have so far:

#include <iostream>
#include <string>

using namespace std;

int main()
{
    cout << "\t\tWelcome to my first game, A Hero's Journey!\n\n";
    char response;
    cout << "\t\t\tPress any key to continue!: \n\n";
    cin >> response;
    if (response == 
    return 0;
}

I am currently working on the if statement, so disregard that unless that's where I decide whether or not a player has pressed something.

anderas
  • 5,744
  • 30
  • 49
  • possible duplicate of [How to simulate "Press any key to continue?"](http://stackoverflow.com/questions/1449324/how-to-simulate-press-any-key-to-continue) – Brian Bi Mar 19 '14 at 05:16

1 Answers1

1

There is no need for an if condition since cin will always wait for an input. If you require the user to input a particular key, then you need an if condition to check it.

Arun
  • 41
  • 1