I think in a function accepting variable number of arguments, there must be atleast one fixed argument that will be treadted as a start of variable argument list. Please correct me if i am wrong
thank Chetan On 10 Apr 2007 23:52:00 -0700, Indika Bandara Udagedara < [EMAIL PROTECTED]> wrote: > > function pointer to variable argument function > hi, > > how can i define a function pointer type to a function that takes variable > number(0 or more) of arguments > > following does not work..?? > > //////////////////////////////////////////////////////////////////// > > /* func ptr to function which takes 0 or more args */ > > typedef void (*func_ptr)(...); > > /* functions that take 0,1 args */ > > void foo(); > > void foo1(int); > > /* assignment DOESN'T COMPILE */ > > func_ptr pfoo = foo; > > func_ptr pfoo1 = foo1; > > gcc error: > > invalid conversion from `void (*)(int)' to `void (*)(...)' > > /////////////////////////////////////////////////////////////////// > > in essence, what i want is a function pointer which is capable of taking > any number of arguments. > > can somebody help me with this? > > indika > > --------------------------------- > Need Mail bonding? > Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users. > > [Non-text portions of this message have been removed] > > > [Non-text portions of this message have been removed]
