Re: Passing variable argument list on to another function
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