getc Vs getchar Vs Scanf for reading a character from stdin
Of the below three functions: getc getchar & scanf which is the best one for reading a character from stdin and why? Are there any known disadvantages or limitations for any of these functions which makes one better than the other? If you simply want to read a single character from stdin, then getchar() is the appropriate choice. If you have more complicated requirements, then getchar() won't be sufficient. getc() allows you to read from a different stream (say, one opened with fopen() ); scanf() allows you to read more than just a single character at a time. The most common error when using