Passing function as argument ?

I have a few functions that each and every one of them returns a boolean .

Then when i call each of them , i would like to make a few attempts for case they fails .

So i need 1 master function that gets one of these functions, and makes a few attempts, so pseudo code :

boolean doA(char *a) {} ;
boolean doB(char *a) {} ;
boolean doC(char *a) {} ;


void overallFuncrion (  doA(char*)  /  doB(char*)  /  doC(char*)  / )
{


          for(int k=0;k<MAX_ATTEMPTS;k++)
    {
       if(  doA/B/C )
         return 1 ;
    }

    return 0 ;
  

}

How do you create, and call this master function with other functions pointers AND their arguments ?

You you do this with the same functions every time, or do they change, for example do you need to run the master function also with doD, doE, doF?

If not, then you don't need to pass function pointers at all.

Try an array of function pointers. Check out this thread.

@aarg no. i have a complete set of known functions ... but their arguments are different.
Are you going to some kind of array ?

i have a complete set of known functions ... but their arguments are different.

You can use an array of function pointers only if all of the functions take the same kind and number of arguments.

You do not need what you think you do. What you do need is to make each function try some number of times.

PaulS:
You can use an array of function pointers only if all of the functions take the same kind and number of arguments.

Which they do in BenStlr's original post. My reply was in direct response to the title of the thread, for the benefit of anyone doing a search on the subject in the future. And I also assumed that this is a learning exercise - trying to learn how to pass the address of a function as an argument, rather than trying to find another way of doing it.

Which they do in BenStlr's original post.

But, BenStlr said:

i have a complete set of known functions ... but their arguments are different.

which is obvious if you look at BenStlr's other posts.

PaulS:
But, BenStlr said:which is obvious if you look at BenStlr's other posts.

Sorry, I stand corrected.
I somehow missed that bit, and was going by his original examples, where all arguments were of the same type, char*.