c - Why are these function names in parenthesis? -


this question has answer here:

i've been meaning ask question while now. what's going on these functions? why names in parenthesis?

void        (*think)(gentity_t *self); void        (*reached)(gentity_t *self);    // movers call when hitting endpoint void        (*blocked)(gentity_t *self, gentity_t *other); void        (*touch)(gentity_t *self, gentity_t *other, trace_t *trace); 

in examples, parenthesis in function name means variable of pointing function address. if don't use parenthesis

void * think(gentity_t *self);// equal (void *) think(gentity_t *self);  

it means definition of function name:think, return: void *, parameter: gentity_t *self; these variable of pointing functions.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -

What is happening when Matlab is starting a "parallel pool"? -