• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Variable argument list not working
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Variable argument list not working (From: Pierre-Olivier Latour <email@hidden>)

  • Prev by Date: Re: Stupid newbie question — determine if in teger is even or odd
  • Next by Date: Re: Re(2): Stupid newbie question - determine if integer is even or odd
  • Previous by thread: Re: Variable argument list not working
  • Next by thread: Re(2): Variable argument list not working
  • Index(es):
    • Date
    • Thread