Subj : Re: Any help on why? To : borland.public.cpp.borlandcpp From : Stan DeGroff Date : Wed Jul 07 2004 03:53 am > >... by putting in some printf statements to aid in debug, That prints the > >variable "xresult" resulted in printing 0x0000. However the variable > >"result" printed ok. > > Wrong type specifier in the printf(). > > printf("%d %X, %X\n", i, xresult, result); > > %X is used with integers. Use %f with doubles. Wayne, I wanted to look at the data as a Hexadecimal floating pt. number. It didn't effect it when I tried %f. "result" worked ok with %X. "xresult" returned 0 in either format. No particular reason. > > Did you type this in or copy & paste? This line looks odd: > > xresult = double va_arg(arglist, double); > It should be a typecast: > xresult = (double) va_arg(arglist, double); > The original text for the function was : ----------- double AddDouble(int x, ...) { va_list arglist; int i; double result = 0.0; printf("The number of arguments is : %d\n", x); va_start(arglist, x); for (i=0; i > -- > Wayne A. King > (waking@idirect.com, Wayne_A_King@compuserve.com) .