home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!portal!dfuller
- From: dfuller@portal.hq.videocart.com (Dave Fuller)
- Subject: Re: Multiple Parameter Passing (unspecified number)
- Message-ID: <BxtrFG.Fq4@portal.hq.videocart.com>
- Organization: VideOcart Inc.
- X-Newsreader: Tin 1.1 PL3
- References: <92321.124834GNR100@psuvm.psu.edu>
- Date: Mon, 16 Nov 1992 19:57:16 GMT
- Lines: 32
-
- GNR100@psuvm.psu.edu writes:
- :
- : Hi.
- :
- : I'm looking to write a function that accepts any number of paramerter.
- : There will be at least two, an int and a char[]. The rest will all be char[]'s.
- : I need to know how this is done. The meathod would be similar to that of
- : printf(), so if anybody know how that works, please let me know.
- : Thanks,
- : Gordon Rogers
- : gnr100@psuvm.psu.edu
-
-
- Gordon,
- Sort of depends. UNIX versions will use definitions from varargs.h and
- non-UNIX platforms use stdarg.h (I believe these are the correct header files).
-
- UNIX versions use va_dcl, va_start, va_end, va_arg, va_list, and va_alist
- non-UNIX versions use va_end, va_arg, va_list
- and va_start (with 1 extra parm)
- (not all of these are macros. va_alist, va_dcl, and va_list are variables)
-
- I haven't used varargs in a while so this may not be complete.
-
- Sorry this is not a full-blown answer, but if it doesn't get you headed
- in the right direction, write me. As i said, i will respond with full
- functional usage of the variable argument scheme.
-
-
- Dave Fuller
- dfuller@portal.hq.videocart.com
-
-