i have a program which displays a certain menu, after the menu it askes for the selection from the menu....now when an integer is used it works perfectly. but when you input a character(letter) in the menu it goes into an infinite loop. anything to use to stop this behavior from a character value(letter)

Recommended Answers

All 3 Replies

Can we see the code?

If you want to use a letter. make the sure the menu selection variable is a char data type. Without seeing the code, this is my best guess on what the problem may be. Post the code so we can see for sure.

I think you want something like this?

a. "one thing"
b. "another thing"

option: -----

for this u must declare a char type variable and do a switch for example.. like the explanation i'll give below

char option;

switch (option)
{
    case 'a':
                  do something...
                  break;
    case 'b': 
                  do something...
                  break;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.