title: Function Pointers within structures in C
body: <pre><code>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(&amp;myitem);
    return 0;
  }
  </code></pre>
  
  <p>This code gives a error at void (<em>footprint)(item</em>). "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)</p>