getche() nd getchar()

Home Forums C Programming getche() nd getchar()

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

  • Author
    Posts
  • #1934

    intvquestion
    Member

    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

    niklaesh
    Member

    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.

0 Shares
Share
+1
Tweet
Share
Stumble