How to pass a function pointer as argument with an argument?
void A(){
    std::cout << "hello" << endl;
}
void B(void (*ptr)()){ // function pointer as agrument
    ptr(); // call back function "ptr" points.
}
void C(string name){
    std::cout << "hello" << name << endl;
}
void D(void (*ptr2)(string name)){ // function pointer as agrument
    ptr2(name); // error 1
}
int main(){
    void (*p)() = A; // all good
    B(p); // is callback // all good
    void (*q)(string name) = C;
    D(q)("John Doe"); // error 2
    return 0;
};
errors:
1 - use of undeclared identifier 'name'
2 - called object type 'void' is not a function or function pointer
 
     
    