Boltar <bo********@yahoo.co.ukwrites:
Is it possible to next variadic functions. Eg if I wish to do
something like this...
void mainfunc(char *fmt, ...)
{
Looks like you hit Send before you finished writing your article.
Function definitions cannot be nested, whether they're variadic or
not. You can *declare* a function inside a function definition:
void foo(void) /* definition of foo */
{
void bar(void); /* delaration of bar */
/* ... */
}
but there's rarely a good reason to do so and 'bar' has to be defined
somewhere else anyway.
See question 20.24 in the comp.lang.c FAQ, <http://www.c-faq.com/>.
--
Keith Thompson (The_Other_Keith)
ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"