`char' parameters

Scott Wilson swilson%thetone at Sun.COM
Thu Sep 1 16:39:17 AEST 1988


>I was aware of what happens to the <<argument>>.
>The passage does not explain, however, what happens when one declares the
>parameter to be type `char' or `float'; I don't see this prohibited
>anywhere.

I was bitten by the float/double version of this once.  I had declared
a formal parameter as a float, took its address and passed what I
thought was a float pointer to another function.  Anyway, I don't have
K&R 2nd edition around, but K&R 1st edition does describe float formal
arguments.  From page 205:

	C converts all float actual parameters to double, so formal
	parameters declared float have their declaration adjusted
	to read double.

Your're right though, that int vs. char is not explicitly mentioned
in this section.


--
Scott Wilson		arpa: swilson at sun.com
Sun Microsystems	uucp: ...!sun!swilson
Mt. View, CA



More information about the Comp.lang.c mailing list