Why putchar, toupper, tolower, etc. take a int instead of a char?
问题 In C, strings are arrays of char ( char * ) and characters are usually stored in char . I noticed that some functions from the libC are taking as argument integers instead of a char. For instance, let's take the functions toupper() and tolower() that both use int . The man page says: If c is not an unsigned char value, or EOF, the behavior of these functions is undefined. My guess is that with a int , toupper and tolower are able to deal with unsigned char and EOF . But in fact EOF is in