title: Clearing Screen in C++/XCode
body: <p>I am trying to write up a C++ program for a class using XCode. One of the things I wish to do, is to simply clear the screen. I've looked into how to do this, however the catch is that the code needs to run on both a Windows and Macintosh computer. I've looked at some other similar questions, but none of the answers help me. I know there is no "screen" but I want the system to clear the output window. I know that the command <code>system("clear");</code> does what I want it to, but when XCode tests the program, instead of clearing the screen it prints <code>TERM Variable not set</code></p>
  
  <p>I've tried opening up the terminal and typing <code>clear</code> and it does in fact respond the way I want it to, so why doesn't the 'terminal' inside of XCode do the same? I just want to get the output window in XCode to respond to <code>clear</code> the same way that the terminal already does.</p>
  
  <p>Here is something I have already tried;</p>
  
  <p>I went to the terminal and ran <code>echo $TERM</code>, to which the terminal responded <code>xterm-256color</code>. I then went over to XCode and opened the "Scheme" settings, and found an Environment Variables setting under "Arguments". I added a variable (to the blank list) called <code>TERM</code> and gave it value <code>xterm-256color</code>. Upon running the program again, the output displays <code>¿[H¿[2J</code> in the output window, positioned where the <code>TERM Variable not set</code> used to be printed.</p>
  
  <p>Last thing, as a reminder, I <strong>cannot</strong> change the source code from the way it is now, or it could cause errors when the program is run on a Windows machine.</p>