Need help with this program (Basic).

This program is basically a test. So after the user selects the start option it will navigate them to the main menu. What I want to know is that after they select the start option, how can I clear the screen and then print out the main menu? So the text doesnt just pile on top of eachother in the command prompt.

Also, later in the program ill be adding more functions (one for each difficulty). Lets say they get to the end of one of the difficulties and want to return to the main menu, how would I do that?

Thanks for any help in advance, I REALLY appreciate it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <iostream>
#include <string>

using namespace std;

void testMainMenu();

int main()
{
    string bMenuChoice;

    cout << "Dumb Test 6.9" << endl;
    cout << "-------------" << endl;
    cout << endl;
    cout << "Start" << endl;
    cout << "Exit" << endl;
    cout << endl;
    cin >> bMenuChoice;

    if(bMenuChoice == "Start")
    {
        testMainMenu();
    }
    else
    {
        cout << "Thanks for playing!" << endl;
    }
}

void testMainMenu()
{
    string difficulty;

    cout << "Dumb Test 6.9 Main Menu" << endl;
    cout << "-----------------------" << endl;
    cout << endl;
    cout << "Select difficulty: " << endl;
    cout << endl;
    cout << "Easy" << endl;
    cout << "Normal" << endl;
    cout << "Medium" << endl;
    cout << "Hard" << endl;
    cout << endl;
    cout << "Difficulty = ";
    cin >> difficulty;
}
Last edited on
http://www.cplusplus.com/articles/4z18T05o/

scroll down to "Windows API"
I didn't really get that. It might need to be dumbed down a bit, I'm kind of a noob. :P
Topic archived. No new replies allowed.