title: Reset after using system call (stty raw)
body: <p>I am using the following code to read and output each keystroke without having to press enter each time. </p>
  
  <pre><code>system("\bin\stty raw");
  </code></pre>
  
  <p>Right after I finish reading, the program does another system call to reset the terminal behaviour. </p>
  
  <pre><code>system("\bin\stty cooked");
  </code></pre>
  
  <p>The thing is, the last line is not resetting the terminal behavior as it should. Everything gets messed up once this program terminates. It continues to read input and does not do anything once an enter or CTRL C or anything else is pressed. </p>
  
  <p>How can I reset the terminal behavior to the one it initially was please? </p>