Trying to use int in getline

Use

cin >> totalquestions;

Check the errors too

if (!(cin >> totalquestions))
{
    // handle error
}

Leave a Comment