home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / cplus / 13417 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  1.1 KB

  1. Path: sparky!uunet!cs.utexas.edu!usc!sdd.hp.com!network.ucsd.edu!sdcc12!sdcc3!acanter
  2. From: acanter@sdcc3.ucsd.edu (Adriaan Canter)
  3. Newsgroups: comp.lang.c++
  4. Subject: C++ Variable Argument Lists (,...)
  5. Keywords: Ellipse, Variable Argument
  6. Message-ID: <37835@sdcc12.ucsd.edu>
  7. Date: 9 Sep 92 04:47:36 GMT
  8. Sender: news@sdcc12.ucsd.edu
  9. Distribution: ca
  10. Lines: 13
  11. Nntp-Posting-Host: sdcc3.ucsd.edu
  12.  
  13.  
  14. Hi there, kind 'o novice question...
  15.  
  16. Is there any way that a function with a variable argument list
  17. (as indicated by ellipses) can tell how many variable arguments have
  18. been passed to it? I'd like to use the va_arg macros in the called
  19. function to extract values from a variable argument list. These macros
  20. return a pointer to the location on the stack where the arguments were
  21. pushed by the calling program. There doesn't seem to be any way to tell
  22. how many of them were passed, however, since with va_arg you can index
  23. as far as you want into the stack. I'd like to get around passing the
  24. number of arguments passed, or terminating the list with a special code.
  25. Is this possible? Thanks - Adriaan Canter.
  26.