title: Count tabs and check line lengths
body: <p>I'm learning c by myself and I'm actually trying to code a program which count the numbers of TAb in a file and if a line has a tab, I want to print the whole line and the numbers of tabs in this line. And if it is not muhch more difficult, I want you to help me to do that also if a line has more than 80 characters, print this line and the numbers of characters
  I have this main function:</p>
  
  <pre><code>include &lt;stdio.h&gt; /* printf */
  
  /* Prototype from tablen.c */
  void tablen(const char *filename);
  
  int main(int argc, char **argv)
  {
    if (argc &lt; 2)
    {
      printf("Usage: tablen filename\n");
      printf("where: filename - file to process.\n");
      return -1;
    }
  
    tablen(argv[1]);
  
    return 0;
  }
  </code></pre>
  
  <p>This main function is very basic so I hope there is no error there.
  And this function too:</p>
  
  <pre><code>include &lt;stdio.h&gt;  /* FILE, fopen, feof, fgets, fclose   */
  include &lt;string.h&gt; /*  strlen */ 
  
  void tablen(const char *filename)
  {
  
      /*Variables*/   
      int i; /*loop controller */
      int tabs = 0; /*number of tabs*/
      int line = 0; /*current line*/
      int size_string; /*size of the string*/
  
      File *file; /* open and read the file */
  
  
      file = fopen(filename, "rt"); /*open the file for read text*/
      size_string = strlen(filename);
  
      /*if we can read the file*/
      if(file)
      {
          /*while we don't reach the end of file, we still reading*/
          while (!feof(file))
          {
              for(i = 0; i &lt; size_string; i++)
              {
                  if(filename[i] == 9) /*ASCII value of TAB is 9 or '\'*/
                  {
                      tabs++;
                  }           
  
                  if(tabs &gt; 0)
                  {
                      printf("# %i: (tabs: %i) |", line, tabs);
                  }
                  if(filename[i] == '\n')
                  {
                      line++;                 
                      tabs = 0;
                  }
  
  
              }
          }
      }
  }
  </code></pre>
  
  <p>I've write this pseudo-code, I think it is correct
  For counting tabs:
  First open a file for read/text
  while there are more line in the file(and reading one by one) we count the number of tabs
  if we found a line with tabs, print the line and the count of tabs
  Of course we close the file</p>
  
  <p>For checking line lengths</p>
  
  <p>First open a file for read/text and hile there are more lines in the file, we heck the length of each line.
  If the line is longer than 80 characters we print that line with length information </p>
  
  <p>I don't know if I am in the correct way because is the first time I try to deal with files</p>