passing variable arguments

Alan J Rosenthal flaps at dgp.toronto.edu
Sun Jun 17 05:58:06 AEST 1990


platt at ndla.UUCP (Daniel E. Platt) writes:
>void	foo(a, b, c)
>char	a, b, c;
>{
>	char	*pt;
>	pt = &a;
>	/* 
>	**	Then:
>	**		pt[0] <-> a;
>	**		pt[1] <-> b;
>	**		pt[2] <-> c;
>	*/

EXTREMELY unlikely.  `char' in "old-style" declarations declares an argument
passed as an integer and converted to a char.  If you're unlucky it won't even
be on the argument stack.

What you say would work for rvalue types such as int, double, long, any pointer
type.

ajr



More information about the Comp.lang.c mailing list