-
May 2nd, 2009, 10:30 PM
#1
Character Input Without Delimiter
I'm looking for some way to grab a single character of input where the character is NOT displayed on the screen, and requires no delimiter. I mean, I want the user to press a key (nothing appears on the console), and the character is returned without hitting the enter key or any other delimiter.
I know there's something in conio.h, but it needs to be ANSI Standard as I'm on Linux.
Thanks in advance.
-
May 3rd, 2009, 03:07 AM
#2
Re: Character Input Without Delimiter
No such thing exists in standard C and standard C++.
-
May 3rd, 2009, 03:20 AM
#3
Re: Character Input Without Delimiter
For this purpose you can try to use the function _getch() defined in conio.h
-
May 7th, 2009, 03:21 PM
#4
Re: Character Input Without Delimiter
Alright, thanks for the replies anyway.
@kakalake
Remember I said "I know there's something in conio.h, but it needs to be ANSI Standard as I'm on Linux."
-
May 7th, 2009, 06:10 PM
#5
Re: Character Input Without Delimiter
Check the ncurses library....not sure if that's precisely what you need, but I know it has a lot of similar types of stuff.
-
May 7th, 2009, 07:59 PM
#6
Re: Character Input Without Delimiter
Yeah ncurses has what you need. It has a no echo thingy.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|