Re: Variable argument list not working
Re: Variable argument list not working
- Subject: Re: Variable argument list not working
- From: Chris Ridd <email@hidden>
- Date: Wed, 14 Aug 2002 08:45:46 +0100
On 13/8/02 7:51 pm, Pierre-Olivier Latour <email@hidden> wrote:
>
> On Tuesday, August 13, 2002, at 02:23 PM, Pierre-Olivier Latour wrote:
>
>
>
>> The problem is I need to pass a variable argument list, not a "va_list"
>
>> argument? Is this possible?
>
>
>
> Yes. You'll need two variants of your function just like there is printf
>
> and vprintf. Look at the prototypes for NSLog and NSLogV and you should
>
> be able to take it from there.
>
>
Thanks for the answer. However, I'm not sure I get it...
>
>
Basically, you mean there's no way to call a function with this prototype
>
from another function with this one?
>
>
void foo1(char* a, ...)
>
void foo2(char* b, ...)
>
>
foo2 calling foo1 passing it the exact same arguments.
>
>
That exactly what I'd like to do.
>
>
From what I've understood, I can only do this:
>
void foo1(char* a, va_list list)
>
void foo2(char* b, ...)
>
>
Is this correct?
Correct. At least if you want portable code (which I believe you said you
did.)
Cheers,
Chris
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.