title: #define, #ifdef #undef #endif
body: <p>I have the following code</p>
  
  <pre><code>#define PROC_ADD
  
  void main(void)
  {
      while(1)
      {
  #ifdef PROC_ADD
  // Do this code here then undefined it to run the code in the else
  // processing work
  #undef PROC_ADD
  #else
  // now that PROC_ADD has been undefined run this code
  // processing work
  #endif
      }
  }
  </code></pre>
  
  <p>However, it will run the code. But it won't run the code in the <code>else</code> after the <code>PROC_ADD</code> has been undefined.</p>
  
  <p>I think the reason could be that you can only define and undefine at compile time, and not at run-time. However, I am not really sure.</p>