How can I nest variadic functions?

B

Boltar

Hi

Is it possible to next variadic functions. Eg if I wish to do
something like this...

void mainfunc(char *fmt, ...)
{
 
K

Keith Thompson

Boltar said:
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/>.
 
K

Keith Thompson

Keith Thompson said:
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/>.

And I see from your other posting that I completely misunderstood what
you were asking.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,188
Latest member
Crypto TaxSoftware

Latest Threads

Top