title: C, #if directive and compilation error: operator '/' has no right operand
body: <p>I ran into an error which I don't understand, mainly because if refers to a commented portion of the code</p>
  
  <p>Basically I have something like:</p>
  
  <pre><code>#ifndef nH
      #define nH 2  // number of hermitian matrices
  #endif
  </code></pre>
  
  <p>And then I have an #if directive</p>
  
  <pre><code>#if (nH != 0)
      gsl_matrix_complex* H[nH];       // hermitian operators
      gsl_vector* evalH[nH];           // eigenvalues of H
  #endif
  </code></pre>
  
  <p>If I try to compile, I get the following error:</p>
  
  <pre><code>error: operator '/' has no right operand
       #define nH 2    // number of hermitian matrices
  </code></pre>
  
  <p>I solved the issue by simply putting the comment above the #define like this:</p>
  
  <pre><code>// number of hermitian matrices
  #ifndef nH
      #define nH 2
  #endif
  </code></pre>
  
  <p>Also, the error does not occur if I cancel the #if directive.
  Still, I don't understand the issue and I'd like to know what exactly went wrong</p>
  
  <p>Thanks </p>
  
  <p>edit:
  so, now I tried to replicate it and it compiles perfectly. I don't know, all I can do is to post a screenshot of the error I got. As you can see there is no space between the two /
  <a href="https://i.stack.imgur.com/nDJnR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nDJnR.png" alt="error"></a></p>