while(1)
{
cout << "Main menu\n";
cout << " 1) Show a list\n";
cout << " 2) Add a name\n";
cout << " 3) exit\n";
}
The above is going to repeat infinitely. You never ask for input or call any other functions.
You also have no way to leave the loop (a break statement or conditional statement in the while).