home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / c / 18344 < prev    next >
Encoding:
Text File  |  1992-12-14  |  1.1 KB  |  37 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!monty@intuitiveedge.com
  3. From: monty@intuitiveedge.com (Montgomery Zukowski)
  4. Subject: recursive variable arguments, can it be done?
  5. Message-ID: <9212142052.AA00201@intuitiveedge.com>
  6. Sender: daemon@magnus.acs.ohio-state.edu
  7. Reply-To: monty@intuitiveedge.com
  8. Organization: The Ohio State University
  9. Date: Mon, 14 Dec 1992 20:52:26 GMT
  10. Lines: 25
  11.  
  12. Let's say I have two functions f1(...) and f2(...) which take a variable  
  13. argument lists.
  14.  
  15. Is there any way to have f1 call f2 function like printf() by passing part of  
  16. the variable argument list (the last part), or if not, then the whole thing?
  17.  
  18. In other words how could I call
  19. f2(va_list ap) 
  20.  
  21. instead of 
  22.  
  23. f2(arg1,arg2,arg3,arg4, etc...)
  24.  
  25. I know that printf() has another function vprintf() which has that sort of  
  26. functionality, but I wonder if there is a simpler way to specify a va_list so  
  27. I don't have to have another function declaration like vprintf does for  
  28. printf.
  29.  
  30. I'm using gcc.
  31.  
  32. Please email me responses since I don't read this newsgroup often.
  33. monty@IntuitiveEdge.com
  34.  
  35. Thanks,
  36. Monty
  37.