CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  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,765

    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
    369

    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
    Seattle, WA
    Posts
    10,895

    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
  •  





Click Here to Expand Forum to Full Width

Featured