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