0

I want to store the name of several functions so that later after doing test on them I can call them if needed, how can I accomplish this>. Here's an example:

typedef struct parser_rule {
    tk_type type;
    ???? function_ptr; // type???
} parser_rule;

void expr(void) { return; }
void ident(void) { return; }

int main(void) {
    parser_rule* this = {lala, expr};
    this->function_ptr();
    this->function_ptr = {meemee, ident};
    this->function_ptr();
    return 0;
}
Hedron
  • 86
  • 1
  • 9

0 Answers0