title: cat file | … vs … <file and my minesweeper
body: <p>I am seeking the explanation and deeper understanding the behaviour of <code>cat file | ...</code>  vs <code>... &lt; file</code>.</p>
  
  <p>I am coding a minesweeper for my assignment, it requires to handle the error instruction and terminate the program once error instruction enter.
  however when I experiment it will the commands. the <code>cat</code> command did not let the program exit until I press enter one more time. but the <code>&lt;</code> command working fine.</p>
  
  <p>would anyone tell me how <code>cat input.in - | ./game4</code> work and why it waiting for my to press enter one more time ?</p>
  
  <ul>
  <li><p><a href="http://i.stack.imgur.com/LIRHN.jpg" rel="nofollow">Manual keyboard input for my homework--minesweeper</a></p></li>
  <li><p><a href="http://i.stack.imgur.com/oIYIs.jpg" rel="nofollow">cat input.in feed minesweeper data</a></p></li>
  </ul>
  
  <p>I am currently doing my assignment, everything is going well and I am studying university of Sydney. However they are hopeless to answer my question.I had very bad experience with them so far. long story short.
  So I would please any one help me because I just a beginner and I already try my best to read all sort of documentation however I am not really good at reading plain text without any example.</p>