title: C, pointer to function in struct, warning "assignment from incompatible pointer type"
body: <p>I have a struct defined as follow:</p>
  <pre><code>typedef struct {
      char (*behave) (int*);
  } BEHAVIOURSTRUCT;
  </code></pre>
  <p>this struct is defined in a .h file and it is included in the .c file
  There i have a global variable (MAX_BEHAVIOURS is defined as 3):</p>
  <pre><code>BEHAVIOURSTRUCT bhvr[MAX_BEHAVIOURS];
  </code></pre>
  <p>and in the init i try to assign this, but here i get the warning: &quot;assignment from incompatible pointer type&quot;</p>
  <pre><code>void init() {
  bhvr[0].behave = BHVR_line_follow; // here
  ...
  }
  </code></pre>
  <p>the function i am trying to asign</p>
  <pre><code>void BHVR_line_follow(int *currstate){
  ....
  }
  </code></pre>
  <p>by the sound of it my declaration in the struct and the pointer to the function are not from the same build, but in my opinion they are. But most likely i am mistaken.</p>