Date: Wed, 8 May 1996 15:29:15 -0400 (EDT) From: Justin Ward To: Rainer Wank cc: djgpp AT delorie DOT com Subject: Re: vararg In-Reply-To: <9605080624.AA16965@malta> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 8 May 1996, Rainer Wank wrote: > void abc(int anzahl, unsigned char abc, ...) > { > va_list ap; > va_start(ap, abc); > fg = va_arg(ap, unsigned char); > printf("\n\rErster variabler Parameter: %d", fg); > va_end(ap); > } You are taking fg as a char, but printing it as an int. With djgpp, and int is 4 bytes and a char is either two or one (I think), depending on whether you're compiling as C or C++. On the sun and on bc 3.1, a char and an int are both 2 bytes it seems. I can't say for sure regarding the sun, but I know this is the case regarding bc. Anyway, just rewrite your printf using %c instead of %d and everything will be fine. Justin