Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

typedef pointer to function

typedef int (*t_somefunc)(int,int);

int product(int u, int v) {
  return u*v;
}

t_somefunc afunc = &product;
...
int x2 = (*afunc)(123, 456); // call product() to calculate 123*456
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #typedef #pointer #function
ADD COMMENT
Topic
Name
1+9 =