Is it possible to use previous arguments in a functions parameter list as the default value for later arguments in the parameter list? For instance,
void f(
I do not think you can do that as that is an illegal syntax. But however, consult the C99 standard in pdf format (n1136.pdf).
However, you may get around this by using static
as in declaring the variables static and using them within the function f
static int global_a; /* In some other spot where you are calling f(), do this beforehand */ /* global_a = 4; f(); */ void f(void){ int a = global_a; b = c = a; /* ..... */ }
Kudos to Michael Burr for pointing out my error! :)
It sounds like you need to rethink your code and change it around for something like that.