getc()

  • This function gets single character as input and returns an integer value. If this fails, it returns EOF.

Syntax of getc()

int getc(FILE *stream);

getchar()

  • The function getchar() reads the character from the standard input while getc() reads from the input stream.

 Syntax of getchar() 

  int getchar(void);

getch()

  • The function getch() is a non-standard function.
  • It is included in “conio.h” header file.
  • Getch() is not a part of standard library.
  • It returns the entered character without even waiting for the enter key.

  Syntax of getch()

int getch();

getche()

  • Like getch(), the getche() function is also a non-standard function and is included in “conio.h” header file.
  • It reads a single character from the keyboard and returns it immediately without even waiting for enter key.

 Syntax of getche()

int getche(void);

 

 

 

 

Categorized in: