title: Implementing callback functions in C
body: <p>I am a newbie to C. I am trying to implement callback function using function pointers.</p>
  
  <p>I am getting an error </p>
  
  <pre><code>:test_callback.c:10: error: expected identifier or ‘(’ before ‘void’
  </code></pre>
  
  <p>when I try to compile the following program:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  void (*callback) (void);
  
  void callback_proc ()
  {
    printf ("Inside callback function\n");
  }
  
  void register ((void (*callback) (void)))
  {
    printf ("Inside registration \n");
    callback (); /* Calling an initial callback with function pointer */
  }
  
  int main ()
  {
    callback = callback_proc;/* Assigning function to the function pointer */
    register (callback);/* Passing the function pointer */
    return 0;
  }
  </code></pre>
  
  <hr>
  
  <p>What is this error?Can anyone help?</p>