Tuesday, 23 August 2011

What is difference between Getchar( ) , Getch ( ) , Getche ( ) ?

getchar ( ) - It will accept a character from keyboard , displays immediately while typing and we need to press Enter key for proceeding.

getch ( ) - It just accepts a keystroke and never displays it and proceeds further. Normally we use it at the end of the main ( ).

getche ( ) - It will accept a character from keyboard , displays it immediately and does not wait for Enter key to be pressed for proceeding.

getc() :The getc() function shall be equivalent to fgetc() , except that if it is implemented as a macro it may evaluate stream more than once, so the argument should never be an expression with side effects.

No comments:

Post a Comment