How can i read a key from keyboard without pressing carriage key?please help...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dreiko466
    New Member
    • Jan 2008
    • 14

    How can i read a key from keyboard without pressing carriage key?please help...

    Hi everyone,

    I am a newbie in C and i can not fing a way to read keys from the keyboard immediately without having to press carriage key.
    scanf, getc, getchar, need to press carriage in order to input the character in the programm.
    Is there any way to bypass the carriage key???







    Thank you for your help,
    --Dreiko--
  • ashitpro
    Recognized Expert Contributor
    • Aug 2007
    • 542

    #2
    Originally posted by dreiko466
    Hi everyone,

    I am a newbie in C and i can not fing a way to read keys from the keyboard immediately without having to press carriage key.
    scanf, getc, getchar, need to press carriage in order to input the character in the programm.
    Is there any way to bypass the carriage key???







    Thank you for your help,
    --Dreiko--
    You can use getch() or getche() or kbhit()

    Comment

    • dreiko466
      New Member
      • Jan 2008
      • 14

      #3
      Originally posted by ashitpro
      You can use getch() or getche() or kbhit()
      Thank you ashitpro, my problem solved.

      --Dreiko--

      Comment

      • Simonius
        New Member
        • Feb 2008
        • 47

        #4
        I've also been wondering about that, is there a C++ coding for that because getch, ... is c code.

        Comment

        Working...