title: Calling function pointed by void* pointer
body: <p>I have an event struct that looks like this</p>
  
  <pre><code>typedef struct {
      void* fn;
      void* param;
  } event;
  </code></pre>
  
  <p>How can I call this function by pointer as part of the struct.  For example, these do not work:</p>
  
  <pre><code>event-&gt;(*function)();
  event-&gt;function();
  (*event-&gt;function)();
  </code></pre>
  
  <p>I want to know how to make the function call both with and without using the additional void* param.  I was originally using this link as a reference:</p>
  
  <p><a href="http://www.cprogramming.com/tutorial/function-pointers.html" rel="noreferrer">http://www.cprogramming.com/tutorial/function-pointers.html</a></p>
  
  <p>I've used these function pointers before, but have trouble getting the syntax correct.</p>