home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / cplus / 18878 < prev    next >
Encoding:
Internet Message Format  |  1993-01-09  |  1005 b 

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!howland.reston.ans.net!paladin.american.edu!darwin.sura.net!gatech!rutgers!ucla-cs!oahu.cs.ucla.edu!alexis
  2. From: alexis@oahu.cs.ucla.edu (Alexis Wieland)
  3. Newsgroups: comp.lang.c++
  4. Subject: Passing unknown number of arguements through a function (?)
  5. Message-ID: <1993Jan9.220155.29398@cs.ucla.edu>
  6. Date: 9 Jan 93 22:01:55 GMT
  7. Sender: usenet@cs.ucla.edu (Mr Usenet)
  8. Organization: UCLA, Computer Science Department
  9. Lines: 19
  10. Nntp-Posting-Host: oahu.cs.ucla.edu
  11.  
  12.  
  13. Apologies for the naive question, but:
  14.  
  15. I just want to pass an unknown number of agruements through a
  16. function.  I had originally assumed I could do something like:
  17.  
  18. foo_printf (char* format ...) {
  19.     char buf [1024];
  20.     sprintf(buf, format ...);
  21.     /* rest of code */
  22. }
  23.  
  24. But this, or anything else I've been able to come up with, doesn't work :-(
  25. What is the proper way of doing this sort of thing ?
  26.  
  27. Please send replies to me directly.
  28. Thanks,
  29.  
  30.   - alexis.                  <alexis@cs.ucla.edu>
  31.