title: Array of Function-Pointers with different functions return value (in C)
body: <p>I've seen some examples of array of function-pointers (<a href="https://stackoverflow.com/a/252750/6296435">here</a>, for example)</p>
  
  <p>In the examples I've seen the array holds functions that have a return value of the same type (all int's, or all void's for example).</p>
  
  <p>But I'm wondering can you have an array that holds function-pointers of different types?</p>
  
  <p>The next code won't compile:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void Empty_Funcion()
  {
      ;
  }
  int funcAdd(int a, int b){
      return a+b;
  }
  
  int main()
  {
      int ret = 0;
  
      void *array[5] = {&amp;Empty_Funcion, &amp;funcAdd, &amp;Empty_Funcion, &amp;funcAdd, &amp;Empty_Funcion};
  
      ret = (*array[1])(5,7);
  
      printf("%d\n", ret);
  
      return 0;
  }
  </code></pre>
  
  <p>It says the problem is with the assignment ret =... "void value not ignored as it ought to be".</p>