home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / c / 18562 < prev    next >
Encoding:
Internet Message Format  |  1992-12-18  |  1.3 KB

  1. Path: sparky!uunet!olivea!charnel!sifon!thunder.mcrcim.mcgill.edu!mouse
  2. From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: recursive variable arguments, can it be done?
  5. Message-ID: <1992Dec17.215727.6616@thunder.mcrcim.mcgill.edu>
  6. Date: 17 Dec 92 21:57:27 GMT
  7. References: <9212142052.AA00201@intuitiveedge.com>
  8. Organization: McGill Research Centre for Intelligent Machines
  9. Lines: 25
  10.  
  11. In article <9212142052.AA00201@intuitiveedge.com>, monty@intuitiveedge.com (Montgomery Zukowski) writes:
  12.  
  13. > Let's say I have two functions f1(...) and f2(...) which take a
  14. > variable argument lists.
  15.  
  16. > Is there any way to have f1 call f2 function like printf() by passing
  17. > part of the variable argument list (the last part), or if not, then
  18. > the whole thing?
  19.  
  20. No.  You need to find or create a version of f2 that takes a va_list
  21. parameter instead of all the variable arguments.  (In some
  22. circumstances, taking a va_list * might be preferable.)  See the FAQ
  23. for more.
  24.  
  25. > I know that printf() has another function vprintf() which has that
  26. > sort of functionality, but I wonder if there is a simpler way to
  27. > specify a va_list so I don't have to have another function
  28. > declaration like vprintf does for printf.
  29.  
  30. No, there isn't; that's why vprintf exists.
  31.  
  32.                     der Mouse
  33.  
  34.                 mouse@larry.mcrcim.mcgill.edu
  35.