0 votes
in C Plus Plus by
What is the difference between getc(), getchar(), getch() and getche().

1 Answer

0 votes
by
  • getc(): The function reads a single character from an input stream and returns an integer value (typically the ASCII value of the character) if it succeeds. On failure, it returns the EOF.
  • getchar(): Unlike getc(), gechar() can read from standard input; it is equivalent to getc(stdin).
  • getch(): It is a nonstandard function and is present in ‘conio.h’ header file which is mostly used by MS-DOS compilers like Turbo C. 
  • getche(): It reads a single character from the keyboard and displays it immediately on the output screen without waiting for enter key.

Related questions

0 votes
asked Jan 9 in C Plus Plus by GeorgeBell
0 votes
asked Jan 4 in C Plus Plus by GeorgeBell
...