title: Remap function pointer
body: <p>I have below code where I need to remap(redefine) C_FLASH_FUNCTION_ADDRESS.</p>
  
  <pre><code>int main(void) {
      // your code goes here
  
      execute_this();
  
      pPointerToFunc = (void *)*(uint32_t *)C_FLASH_FUNCTION_ADDRESS;
  
      pPointerToFunc();
  
      return 0;
  }
  </code></pre>
  
  <p>The reason why I need to redefine <code>C_FLASH_FUNCTION_ADDRESS</code> is, <code>C_FLASH_FUNCTION_ADDRESS</code> is some location in FLASH memory where address of some other function is stored. Since I don't have FLASH, I want to redefine C_FLASH_FUNCTION_ADDRESS to some address in RAM. For any reason I Shouldn't have to change the line: <code>pPointerToFunc = (void *)*(uint32_t *)C_FLASH_FUNCTION_ADDRESS;</code></p>
  
  <p>I've tried below code to do this, this compiles however run-time error occurs.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void Testing_pOP_Start(void)
  {
      printf("Inside");
      return;
  }
  
  typedef unsigned int uint32_t;
  
  #define C_FLASH_FUNCTION_ADDRESS (ptemp)
  
  void (*pPointerToFunc)(void);
  
  unsigned long ptemp;
  
  void execute_this(void)
  {
      ptemp = (unsigned long)(&amp;Testing_pOP_Start);
  }
  
  
  int main(void) {
      // your code goes here
  
      execute_this();
  
      pPointerToFunc = (void *)*(uint32_t *)C_FLASH_FUNCTION_ADDRESS;
  
      pPointerToFunc();
  
      return 0;
  }
  </code></pre>
  
  <p>Please help me find out what is wrong and how do I achieve this. </p>