title: C Program to count comment lines (// and /* */)
body: <p>I need a program to count the lines of a .txt or .c file and return me the following things:</p>
  
  <p>File:  <br>
  Simple Comment: N lines <Br>
  Multiline Comment: N lines <br>
  Total Lines: N lines <br></p>
  
  <p>I have this:</p>
  
  <pre><code>if (pFile != NULL) 
  {
      do { 
      c = fgetc(pFile);
  
      if (c == '\n') n++;
  
      } while (c != EOF);
  </code></pre>
  
  <p>And I don't know how to implement the rest of it. <Br>
  I tried with the strstr() function as well, didn't get it neither.</p>