[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: help!



chetan dutta wrote:

> Hi!
>
> i am writing a c fx with variable # of arguments, declared as
>
> int my_func(int a, char b,...);
>
> the problem is va_arg()(declared in  stdarg.h) can not handle floats, it can
> handle int, char * etc
> and my_func() needs to handle variable number of float args,
> how can i use float in a function with variable number of args?
>
> please suggest me a way around to handle this problem.

why dont u take the float value as a char, actually... take any value as a char
and then, in the program convert it(using the various
converters...atoi,atof...etc)... that is what i allways do... removes all
problems.....
u want the algo... ask me nicely!!!!!