while((x= fgetc(p)) != EOF)
 {
  if (x== '/')
  {
      while((x = fgetc(p)) != EOF && x != '\n' && x != '/')
      {
          comments++;
      }
  }
}
Basically all I need is a way to count all the commented symbols in a file. This is the way i tried but it didn't work. Help is much appreciated :).
 
    