title: Function pointers table in C
body: <p>I'm doing a Forth interpreter in C. I can't decide how to better implement the Forth dictionary.</p>
  
  <pre><code>struct Word {
     struct Word* next;
        char* name;
        int* opcode;
        // int arg_count;
  }
  struct Dictionary {
      struct Word words;
      int size;
  }
  </code></pre>
  
  <p><code>opcode</code> is a sequence of codes - functions of word. So each <strong>opcode[i]</strong> corresponds to some function. I suppose it should be some table with elements <em>[opcode&lt;->function pointer]</em>. But how to implement it? </p>
  
  <p>We don't know the size of function. We can't use <strong>void*</strong> (or we can?) since we must somehow having only opcode execute the function.</p>
  
  <p>What should I do?</p>