getche() nd getchar()

Home Forums C Programming getche() nd getchar()

This topic contains 1 reply, has 2 voices, and was last updated by  niklaesh 12 years, 8 months ago.

  • Author
  • #1934


    why getche() returns the ascii value of newline character as 13 whereas getchar is able to return the correct ascii value of it ie 10

  • #3183


    As far as i know, getche() function echos the character on the screen. and getchar() returns teh next character.
    When u press Enter Button it returns ASCII value 10 and ASCII value 10 is the orignal n character.
    And you know on the STDIO when u press enter button it means a n character.
    This is my idea. Any one else migh have the correct answer.

You must be logged in to reply to this topic.