Can I set a default argument from a previous argument?

The answer is no, you can't. You could get the behaviour you want using overloads:

void f(int a, int b, int c);
inline void f(int a, int b) { f(a,b,b); }
inline void f(int a)        { f(a,a,a); }

As for the last question, C doesn't allow default parameters at all.


No, that is not legal C++. This is specified in section 8.3.6/9 of the C++ Standard:

Default arguments are evaluated each time the function is called. The order of evaluation of function arguments is unspecified. Consequently, parameters of a function shall not be used in default argument expressions, even if they are not evaluated.

and:

int f(int a, int b = a); // error: parameter a used as default argument

And C89 at least does not support default parameter values.