title: make program also read from file instead of stdin
body: <p>How do I change the following code so that it also goes through files instead of just stdin? 
  For example the program would work if I do <code>./detag blah</code> where blah is a text file?</p>
  
  <p>Do I use an if statement and try to <code>cat</code> it?</p>
  
  <pre><code>int main() {
     int in_tag = 0;
     char c;
  
     while ((c = getchar()) != EOF) {
         if (c == '&lt;' || c == '&gt;') {
             in_tag = (c == '&lt;') ? 1 : 0;
         } else {
             if (!in_tag) {
                 putchar(c);
             }
         }
     } }
  </code></pre>