62.1k views
4 votes
(In C prog.) What is the difference between scanf, getche and getchar?

User Iamjpg
by
8.0k points

1 Answer

5 votes
getchar() only reads a single character input from any input stream.
getche() reads a single character from the keyboard and displays immediately on output screen without waiting for enter key
scanf() reads the whole input line according to the data type you specified.


User Jason Antman
by
8.5k points