Answers:
getc():I<span style="color: rgba(0, 0, 0, 0.84); font-family: Roboto, sans-serif; font-size: 16px;">t reads a single character from a given input stream and returns the corresponding integer value</span>
<span style="color: rgba(0, 0, 0, 0.84); font-family: Roboto, sans-serif; font-size: 16px;">The difference between getc() and getchar() is getc() can read from any input stream, but getchar() reads from standard input. </span>
getch is available only in conio.h which is NOT standard C library, as conio.h is available only in windows systems. getc can be used in any system.
One more difference is :
getc() will echo the character on screen so anyone can see which KEY is pressed.
While
getch() doesn't echo the character pressed by user.
Login to add comment