Looks like this is not supported...
Code: Select all
void some_function(int some_param = 0);
Default parameters are a C++ feature.
I've seen some people use macros to simulate default parameters.
Code: Select all
#define some_function_0() some_function_impl(100,200)
#define some_function_1(a) some_function_impl(a,200)
#define some_function_2(a,b) some_function_impl(a,b)
extern void some_function_impl(int a, int b);
void main(void)
{
some_function_0();
some_function_1(500);
some_function_2(0,1);
}
The names of the macros are differentiated by the number of parameters they take.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org!
http://sdm.link/slashdot