I am a beginner in C++ and stack exchange. I am working on an Interface class that gets keyboard input and checks to see whether it is correct through looping through an arr
You should do something as shown below:
#include
struct Input_Interface {
struct command_output {
std::string command;
void (*output_function)();
};
static void Clear();
static void Quit_loop();
};
int main() {
Input_Interface::command_output t = {"CLEAR", Input_Interface::Clear};
return 0;
}
Live example here
Although I would suggest using a functor object over function pointer.