Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
What is the difference between getc(), getchar(), getch() and getche().
Home
C Plus Plus
What is the difference between getc(), getchar(), getch() and getche().
asked
Jan 12
in
C Plus Plus
by
GeorgeBell
What is the difference between getc(), getchar(), getch() and getche().
c-interview-questions-answers
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Jan 12
by
GeorgeBell
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.
...