- This topic has 1 reply, 2 voices, and was last updated 18 years, 10 months ago by .
Viewing 1 reply thread
Viewing 1 reply thread
- The forum ‘General Discussion’ is closed to new topics and replies.
Home › Forums › General Discussion › Problem here
Hey, how do u force a user to enter only letters from the keyboard in an Ansi C console Application? I’m trying to write a small program but it goes crazy when I enter any thing numeric, which I shouldn’t do.
Hello, wel if u can post the code in which u r facing difficulties.
As far as I understand below is the solution for ur problem.
1 2 3 4 5 6 7 | while((key=getch())!=ESC)<br /> {<br /> switch(getch()){<br /> //case 1 to 10 do nothing<br /> //case write the characters on the screen<br /> }<br /> } |
To me this is the shortest solution to the problem above.