Quote Originally Posted by Programmer_P
Why does the strchr function want a int type passed into its second parameter
MK27's explanation of EOF is feasible, though it might be more likely because character literals in C are of type int, and strchr is taken from the C standard library.

Quote Originally Posted by Programmer_P
why does passing a char into it work without any compiler error?
Conversion from char to int is perfectly fine. It will probably not generate any warnings, and I do not recommend a cast.