A question about variable-argument lists



 DEVELOP > c-Plus-Plus > A question about variable-argument lists

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: "red floyd"
Date: 27 Dec 2007 11:19:07 PM
Object: A question about variable-argument lists
A function foo is defined as:
int foo(string, ...);
How to determine there are how many arguments in the list?
something in the first argument has to determine this.
.

User: "Dave Rahardja"

Title: Re: A question about variable-argument lists 27 Dec 2007 11:47:43 PM
On 2007-12-27 23:19:07 -0600, red floyd <no.spam@here.dude> said:

A function foo is defined as:
int foo(string, ...);

How to determine there are how many arguments in the list?

something in the first argument has to determine this.

Probably.
See the documentation for <stdargs.h> for details.
There is very little incentive to create new variable argument
functions in C++. Use function overloading or vectors instead.
-dr
.

User: "Mike Smith"

Title: Re: A question about variable-argument lists 28 Dec 2007 06:45:26 PM
red floyd wrote:

A function foo is defined as:
int foo(string, ...);

How to determine there are how many arguments in the list?

something in the first argument has to determine this.

Not necessarily. There could be some kind of sentinel value signifying
the last argument in the list (not that I'd particularly recommend this).
--
Mike Smith
.


  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER