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 -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -