passing a va_list to sprintf
From: Shea Martin (shea_at_snowsquirrel.ca)
Date: 10/31/03
- Next message: Roose: "Re: Interview question !!!"
- Previous message: Ben Jacobs-Swearingen: "very basic C question -- K & R on a Mac"
- Next in thread: nrk: "Re: passing a va_list to sprintf"
- Reply: nrk: "Re: passing a va_list to sprintf"
- Reply: Peter Pichler: "Re: passing a va_list to sprintf"
- Reply: Shea Martin: "Re: passing a va_list to sprintf"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 31 Oct 2003 07:43:12 GMT
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.
Thanks.
~S
- Next message: Roose: "Re: Interview question !!!"
- Previous message: Ben Jacobs-Swearingen: "very basic C question -- K & R on a Mac"
- Next in thread: nrk: "Re: passing a va_list to sprintf"
- Reply: nrk: "Re: passing a va_list to sprintf"
- Reply: Peter Pichler: "Re: passing a va_list to sprintf"
- Reply: Shea Martin: "Re: passing a va_list to sprintf"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|