help request - regarding keywords for a text based game

I'd like to start off by saying I was hesitant to post and will not request help coding or debugging directly because I realize a language is best learned through self gained experience.

With that out of the way, my question is simple.

When searching google or other resources, what keywords would you guys recommend using to accomplish the following goal:

Create a starting location in the main function. (location1 for example)
& Display options so a user may switch from location1 to location2 or 3.

NOTES:
-the user will be asked for input to move
-for example, they can type sect2 to move from the starting point(sect1) to section2
-please excuse any grammar errors in this post, it was a bit rushed

If my concept is not well defined please feel free to ask questions. If you understand, then all I ask for is the keywords I would need to find the knowledge I seek. :)

Below is the code I will be adding to:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
#include <string>
using namespace std;

char playername[20];

string mo_s1("move s1"), mo_s2("move s2");
string sm_s1("sm in s1"), he_s1("he in s1"), to_s1("to in s1"), ta_s1("ta in s1"), se_s1("se in s1");
string sm_s2("sm in s2"), he_s2("he in s2"), to_s2("to in s2"), ta_s2("ta in s2"), se_s2("se in s2");
string sm_s3("sm in s3"), he_s3("he in s3"), to_s3("to in s3"), ta_s3("ta in s3"), se_s3("se in s3");

int main()
{
    int n;

    cout << "blahblah someone asks, 'Who are you?'\n";
    cout << "\n \n" << "...";
    cout<<"your name: ";
    cin >> playername;
    cout << "\n" << "It's me, " << playername << ". remember?";
    cout << "\n \n" << "press enter to continue, type 0 to quit";
    cin >> n;
    return 0;
}
What I would do, is have the parser turn every possible direction into an int. I would have each 'room' be it's own instance of a class, with pointers pointing to all connected rooms. I would have the player class keep track of what room he is in. These connections would be tied to the int. So a certain room has one exit, north, which is considered exit 1. The user enters north, the parser feeds 1 to the room class, the class feeds the address of the room change to the player class, the player class updates what room he is in. If the player enters a direction that the room isn't connected to, it would get it, see that the pointer to that direction is null, then output text to say that a mountain is in the way, or w/e.
Many thanks Intrexa :)
Another option would be to use a std::map<std::string, Room&> inside of each room, let each room have a name, and do it a little something like this:
1
2
3
4
void Room::addNeighbor(Room& room)
{
roomMap.insert(room.getName(), room); /*you may wanna have some code to resolve name collisions here, just in case - maybe throw an exception*/
}
Topic archived. No new replies allowed.