Help with varargs

David P. Schaumann dave at cs.arizona.edu
Tue Mar 13 09:00:05 AEST 1990


I want to write a routine that uses variable number of args that passes
*all* of it's args to another routine.  I tried this:

	int s( size, va_alist )
	int size ;
	va_dcl

	{ t( size, va_alist ) ; }

	int t( size, va_alist )
	int size ;
	va_dcl

	{ int i ;
	  va_list ap ;

	  /* do some stuff with va_alist */

	}

Unfortunately, when I do this, only the first value in va_alist is right.
Everything else is garbage.  Anybody know how to fix this?

				Thanx, Dave
				dave at cs.arizona.edu



More information about the Comp.lang.c mailing list