typedef struct Item{
int i;
int j;
void (*fooprint)(item*);
}item;
void fooprint(item *it){
printf("%d\n",it.i);
}
int main(){
item myitem;
myitem.i=10;
myitem.j=20;
myitem.fooprint = fooprint;
myitem.fooprint(&myitem);
return 0;
}
This code gives a error at void (footprint)(item). "The error is expected ‘)’ before ‘*’ token ". Am I missing something ? When I do the same without using pointer to the structure is works. Example : void (*footprint)(item)