|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
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 |
|
![]() |
| Outils de la discussion | |
|
|