Character Input Without Delimiter
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Character Input Without Delimiter

  1. #1
    Join Date
    May 2009
    Posts
    2

    Question 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.

  2. #2
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,193

    Re: Character Input Without Delimiter

    No such thing exists in standard C and standard C++.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  3. #3
    Join Date
    May 2000
    Location
    Germany
    Posts
    368

    Re: Character Input Without Delimiter

    For this purpose you can try to use the function _getch() defined in conio.h

  4. #4
    Join Date
    May 2009
    Posts
    2

    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."

  5. #5
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Fairfax, VA
    Posts
    10,885

    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.

  6. #6
    Join Date
    Apr 2009
    Posts
    12

    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
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center