Alex Rivera | Logout

Function pointers with default parameters in C++

Asked 2010-04-05T00:23:41.850
37

How does C++ handle function pointers in relation to functions with defaulted parameters?

If I have:

void foo(int i, float f = 0.0f);
void bar(int i, float f);


void (*func_ptr1)(int);
void (*func_ptr2)(int, float);
void (*func_ptr3)(int, float = 10.0f);

Which function pointers can I use in relation to which function?

Edit
Report

1 Answer

1

Default argument cannot be provided for pointers to functions.

answered 2013-08-02T16:55:11.350

Your Answer