Re: passing a va_list to sprintf
From: Peter Pichler (pichlo6_at_pobox.sk)
Date: 10/31/03
- Next message: rihad: "Re: calloc(1,1) vs. *malloc(1)=0"
- Previous message: Peter Pichler: "Re: casting"
- In reply to: Shea Martin: "passing a va_list to sprintf"
- Next in thread: Shea Martin: "Re: passing a va_list to sprintf"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 31 Oct 2003 08:26:01 -0000
"Shea Martin" <shea@snowsquirrel.ca> wrote in message
news:kooob.230908$pl3.90584@pd7tw3no...
> I have a function:
>
> void f(char* format, ...)
> {
> va_list args;
> char buf[128];
> sprintf(buf, format, args);
> printf(buf);
> }
>
> But I can't get sprintf to properly take the args I have given to f(). I
can't
> seem to find any examples on passing a va_list.
>
> Any help would be appreciated.
Try vsprintf.
- Next message: rihad: "Re: calloc(1,1) vs. *malloc(1)=0"
- Previous message: Peter Pichler: "Re: casting"
- In reply to: Shea Martin: "passing a va_list to sprintf"
- Next in thread: Shea Martin: "Re: passing a va_list to sprintf"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|