• 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: Passing variable argument list on to another function
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing variable argument list on to another function


  • Subject: Re: Passing variable argument list on to another function
  • From: Andrew Pinski <email@hidden>
  • Date: Thu, 23 Aug 2001 12:30:33 -0400

Use vsnprintf instead of sprintf it is described in printf(3) man page.

Almost never use sprintf, use snprintf.

Thanks,
Andrew Pinski

On Thursday, August 23, 2001, at 12:15 PM, Christian Mike wrote:

As you have seen from previous e-mails, I am fighting a difference between
NSString string formats and printf. I would like to do the following:

[myMutableString myAppendFormat:formatString,argList...];

and write my own function that essentially does:

-(void)myAppendFormat:(NSString *)formatString,...
{
char cString[1024];
va_list argList;

sprintf(cString,[formatString cString],argList);
[self appendString:[NSString stringWithCString:cString]];
}

But this doesn't seem to work quite right. How can I pass the variable
argument list portion of this on to sprintf?

Thanks.

Michael Christian
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


  • Prev by Date: Re: Docs
  • Next by Date: Re: Passing variable argument list on to another function
  • Previous by thread: Re: Passing variable argument list on to another function
  • Next by thread: Re: Passing variable argument list on to another function
  • Index(es):
    • Date
    • Thread