Welcome! Log In Create A New Profile

Advanced

va_list

Posted by KolakCC 
va_list
November 22, 2009 02:32PM
Hii all!
I'm trying towrite a concat code that works on va_list..
This is what i have now:
String currtext;
void concat(int count, ...) {
	va_list argp;
	va_start(argp, count);
	for (int j = 1; j <= count; j++) {
		currtext+=va_arg(argp, char *);
	}
	va_end(argp);
}
I've scoured internet and google, but i can't find the answer:
How can i rewrite this function so you don't have to specify how many args there are?

Thanks a lot,
Dereck
Re: va_list
November 22, 2009 02:47PM
Use a linked list.
Re: va_list
December 06, 2009 09:10AM
void gprintf( const char *str, ... )
{
        if (!(geckoinit))return;

        char astr[4096];

        va_list ap;
        va_start(ap,str);

        vsprintf( astr, str, ap );

        va_end(ap);

        usb_sendbuffer_safe( 1, astr, strlen(astr) );
} 
Sorry, only registered users may post in this forum.

Click here to login