Mixing char and int types as parameters in portable (summary).
Doug Gwyn
gwyn at brl-vgr.ARPA
Wed Mar 21 08:54:23 AEST 1984
' ' is NOT a char, despite appearances. It is an int. So is 'ab'.
Actual arguments to functions are widened depending on type (this is a
side-effect of the PDP-11 implementation, now embedded in the language).
Chars are widened to ints and floats are widened to doubles.
Therefore it makes little sense to declare the formal parameters of a
function to be type char or float, since actual arguments never will be.
More information about the Comp.lang.c
mailing list