How do function pointers work?
问题 I'm asking some specific questions. How can I initialize them in a class? How can I pass a function as an argument? Do function pointers need to be declared and defined in the class? For question number 2 here is what I mean: void s(void) { //... } void f(function) { // what should I put as type to pass a function as an argument //... } f(s); 回答1: To define a function pointer, use the following syntax: return_type (*ref_name) (type args, ...) So, to define a function reference named