Re: Trouble with va_list processing
- From: Nelu <please@xxxxxxxxxxxxxx>
- Date: Thu, 02 Feb 2006 21:29:33 -0500
thierrydollar wrote:
I have written another example of the problem with va_listPlease read http://cfaj.freeshell.org/google/
And here is the result
format = %s
arg[] = hello
format = %s
arg[] = ä ↕
Here is the source code
#include <stdio.h>
#include <stdarg.h>
//---------------------------------------------------------------------------
void add (char *format, ...)
{
va_list args;
va_start (args, format);
printf("format = %s\n",format);
printf("arg[] = %s\n", va_arg (args, char *));
}
//---------------------------------------------------------------------------
void set (char *format, ...)
{
va_list args;
va_start (args, format);
add(format, args);
}
//---------------------------------------------------------------------------
int main()
{
char txt[] = "hello";
add ("%s",txt);
set ("%s",txt);
return 0;
}
//---------------------------------------------------------------------------
Thank you!
--
Ioan - Ciprian Tandau
tandau _at_ freeshell _dot_ org (hope it's not too late)
(... and that it still works...)
.
- References:
- Trouble with va_list processing
- From: thierrydollar
- Re: Trouble with va_list processing
- From: Thad Smith
- Re: Trouble with va_list processing
- From: thierrydollar
- Re: Trouble with va_list processing
- From: Chris Dollin
- Re: Trouble with va_list processing
- From: thierrydollar
- Trouble with va_list processing
- Prev by Date: Re: Trouble with va_list processing
- Next by Date: Re: Checksum method determination
- Previous by thread: Re: Trouble with va_list processing
- Next by thread: Re: Trouble with va_list processing
- Index(es):
Relevant Pages
|