Dev C++ How Validate Char For Specific Character

How to validate characters or int so that when a program like below only wants numbers and the user inputs letters my mistake, I want to add to program so it does not accept characters accept numbe.

Dev c++ how validate char for specific character list

Dev C How Validate Char For Specific Character Are You

Here is my code, I tried your suggestion but if I entered rr or dhfu or anything except a single character the game starts playing itself over and over again at light speed. What I need is a way to only accept one key stroke if user enters more than one. Thanks
char letter;// To hold cin value.
while (letter != 'e')//while loop.
{
cout << ' This is a dice game that you play with the computer as your opponent.n';
cout<< ' The highest total resulting from a roll of two dice wins the game!!nn';
cout << ' Press r to roll the dice or e to exit the game, then press enter. ';
cin >>letter;
srand((unsigned)time(0)); //Initialize random number generator (not sure if I am using this correctly).
//Random number generator
playerDice1 = (rand() % 6) + 1;
playerDice2 = (rand() % 6) + 1;
compDice1 = (rand() % 6) + 1;
compDice2 = (rand() % 6) + 1;
if (letter 'e')// An if statement, player enters e the program terminates.
break;
if (letter != 'r')/* An if Statement, player enters anything except p a heckling message
is displayed and computer beeps 3 times. Player enters p the program continues*/