getchar() returns an intThis tip submitted by Rob on 2004-12-29 00:00:00. It has been viewed 28552 times.
Rating of 5.6 with 221 votes
The function getchar() is perhaps named in such a way as to be misleading to novice programmers. It does get a character, but it returns an int. Always assign the return value of getchar() to an int type variable. Read a little more about getchar() here.
Help your fellow programmers! Add a tip!