Kod, aby nie wprowadzać / pomijać danych wejściowych użytkownika w C ++

W poniższym kodzie wystąpił błąd podczas próby nakłonienia użytkownika do wprowadzenia ich nazwy. Mój program pomija go i przechodzi do wykonywania wywołań funkcji, nie pozwalając użytkownikowi na wprowadzenie ich nazwy. Pomimo błędu mój program się kompiluje. Nie jestem pewien, co jest nie tak, ponieważ napisałem tę część na podstawie innych przykładów, które znalazłem tutaj. Jakieś sugestie?

#include <iostream>
#include <string>
#include <time.h>

using namespace std;

char showMenu();
void getLottoPicks(int[]);
void genWinNums(int[]);
bool noDuplicates(int[]);

const int SIZE = 7;

int main()
{
    int userTicket[SIZE] = {0};
    int winningNums[SIZE] = {0};
    char choice;
    string name;

    srand(time(NULL));

    do
    {
        choice = showMenu();

        if (choice == '1')
        {
            cout << "Please enter your name: " << endl;
            getline(cin, name);

            getLottoPicks(userTicket);
            genWinNums(winningNums);

            for (int i = 0; i < SIZE; i++)
                cout << winningNums[i];
        }
    } while (choice != 'Q' && choice != 'q');

    system("PAUSE");
    return 0;
}

Dodano kod do showMenu:

char showMenu()
{
    char choice;

    cout << "LITTLETON CITY LOTTO MODEL:" << endl;
    cout << "---------------------------" << endl;
    cout << "1) Play Lotto" << endl;
    cout << "Q) Quit Program" << endl;
    cout << "Please make a selection: " << endl;
    cin >> choice;

    return choice;
} 

I getLottoPicks (ta część jest bardzo zła i nadal nad nią pracuję):

void getLottoPicks(int numbers[])
{
    cout << "Please enter your 7 lotto number picks between 1 and 40: " << endl;

    for (int i = 0; i < SIZE; i++)
    {
        cout << "Selection #" << i + 1 << endl;
        cin >> numbers[i];
        if (numbers[i] < 1 || numbers[i] > 40)
        {
            cout << "Please choose a number between 1 and 40: " << endl;
            cin >> numbers[i];
        }
        if (noDuplicates(numbers) == false)
            {
                do
                {
                cout << "You already picked this number. Please enter a different number: " << endl;
                cin >> numbers[i];
                noDuplicates(numbers);
                } while (noDuplicates(numbers) == false);
            }
    }
}

questionAnswers(2)

yourAnswerToTheQuestion