title: How to save the error output of gcc to file
body: <p>When I compile my code I get a bunch of errors which I span through the screen and I can see where does the error start. How can I save the output of gcc to a file? </p>
  
  <p>I tried tricks like </p>
  
  <blockquote>
    <p>gcc  > log.txt </p>
  </blockquote>
  
  <p>or grepping the result but it didn't work. Searching google yields mostly result on explaining how to print to file with c++</p>