void f(int a, char b, char* c) {
if(..) {
...
f(a,b,c); //recursive
}
...
}
void g(int a, double b, char* c, int d) {
if(..) {
...
g(a,b,c,d); //recursive
}
...
}
I want to make a separate function because I use the code within the if
statement several times. But this function have to have a function as a parameter becuase I use recursive method. I know that we can use function as a parameters, but in the f
function there are 3 parameters, in the g
function have 4 parameters.
The code in the if statement in f
is the same as the code in the if of g
. Except for the function call in that code?
Simply I have no idea how to solve this issue.