+ 10
Do you think getc(stdin) is equivalent to the use of getchar() ?
question of File Handling in C. use of unformatted input and output
3 ответов
+ 6
getc() can read from any input stream(no matter if it is file stream or standard input stream).
But this is not true in case of getchar().
Although both are used to read a single character, getchar() is used when we want to read a character from standard input stream(because it can only read from standard input stream and not any other stream).
getchar() is equivalent to getc(stdin).
+ 1
hello