Question: I'm very new to programming. I'm trying to make some sort of name generator.

What I want to do, is assign a number to a first name, and last name.

Pompt the user to enter a number (lets say 1-13), and that would give them their "first name".

so, something like 

```
cout << " Enter a number between 1 and 13; ";
cin >> first_name;

```

And the same code above for the "last name", except they would enter a number that is 14 or higher.

I'm assuming you would be using strings..? I don't know what's best.

So..what would be the best way/where should I look, to go about assigning a lot of names/words to numbers?

Answer: 
If I have correctly understood all you need is two arrays with first names and last names. For example

```
const size_t FNAMES_SIZE = 13;
const size_t LNAMES_SIZE = 13;

const char *fname[FNAMES_SIZE] = { "John", "Mathew", "Bob", /*other names */ };
const char *lname[LNAMES_SIZE]  = { "Johnson", "Bush", "Cannedy", /*other names */ };

cout << " Enter a number between 1 and " << FNAMES_SIZE << "; ";
cin >> first_name;

cout << "Your first name is " << fname[first_name - 1] << endl;

cout << " Enter a number between " << FNAMES_SIZE + 1 
     << " and " << FNAMES_SIZE + LNAMES_SIZE << "; ";
cin >> last_name;

cout << "Your last name is " << lname[last_name - FNAMES_SIZE - 1] << endl;

```
For associating one item with another, a good data structure is a `std::map`. 

So, if you want to associate 13 with Oscar, you could use this example:

```
typedef std::map<unsigned int, std::string> Name_Container;
Name_Container first_name_table;
//...
first_name_table[13] = "Oscar";

```

The `std::map` is also known as an *associative array* or *dictionary*. 

One issue with the vector is that there could be holes or empty slots depending on the index number entered by the User. 

If User enters "3 Fred", the vector[3] == "Fred". Unless you expanded the vector to contain more than 3 slots, this will be undefined behavior. 

If User next enters "5 Oliver", there will be an empty slot between 3 and 5. 

With the `std::map`, there are not empty slots.