title: Get the address of a function generated via macro
body: <p>I try to use code which is generating functions via a macro, which looks like this:</p>
  
  <p>File A (Provided file I can't change anything here):</p>
  
  <pre><code>#define FUNCTION_GENERATOR(NUM) \
  void MyGeneratedFunctionNo##NUM##(void) \
  { \
       another_function_call(NUM); \
  } \
  
  FUNCTION_GENERATOR(1)
  FUNCTION_GENERATOR(2)
  FUNCTION_GENERATOR(3)
  </code></pre>
  
  <p>File B (My file where I wanna use function pointers to the generated functions from File A):</p>
  
  <pre><code>typedef void (*function_ptr) (void);
  function_ptr func_array[3];
  func_array[0] = MyGeneratedFunctionNo1;
  func_array[1] = MyGeneratedFunctionNo2;
  func_array[2] = MyGeneratedFunctionNo3;
  ...
  </code></pre>
  
  <p>Naturally the compiler complains that MyGeneratedFunctionNo1, MyGeneratedFunctionNo2, MyGeneratedFunctionNo3 are not defined. </p>
  
  <p><strong>Is there any way to use function pointers with this
  generated functions?</strong></p>