I'm a bit new to C++, so I beg your pardon for being a bit nooby.
Is there a function I can use to make the console pause until a specific key is pressed?
Example being:
#include <iostream>
using namespace std;
int main()
{
    int i = 0;
    if (specific key pressed) {
        i = 1;
    } else if (other key pressed) {
        i = 2;
    }
    cout << i << endl;
    return 0;
}
The console should output 1 if the right key is pressed, and 2 if another key is.
 
     
     
     
    