Passing variable length argument list to functions

brian_helterline brianh at hpcvia.CV.HP.COM
Sat Jul 28 01:14:48 AEST 1990


>I want to create a routine called from C that receives a variable length
>argument list (just like printf() for example). How does one do that in
>C? In fact, if anyone could tell me how printf does it (or where I might
>find the code on my Sparc), that would be good enough.

	Can you say varargs? :)  You probably won't find the source for
	printf, but take a look at vprintf and varargs.h.  These should
	explain how to handle varaible length arguments.
>
>Thanks in advance.

	Your welcome in retrospect.


>------------------------------------------------------------------------------
>Mark P. Stockley    |   INET: mps at hri.com    | But I don't like Spam!!!
>Horizon Research    |  Voice: (617) 466-8361 | 
>1432 Main St.,      |   		     | Is the alphabet in that order
>Waltham MA. 02154   |    FAX: (617) 466-8323 | or is it because of that song?
>------------------------------------------------------------------------------
>----------


-------------------------------------------------------------------------------
Brian Helterline                                        brianh at hpcvia.cv.HP.COM
Hewlett Packard                                         ..!hp-pcd!hpcvia!brianh
Corvallis, OR  97330           				Warning: error C390 - 
							No saying found.
							core dump.



More information about the Comp.lang.c mailing list