Skip to content

Instantly share code, notes, and snippets.

@cjoshmartin
Created September 18, 2016 23:30
Show Gist options
  • Save cjoshmartin/23b463434d587231e9f5911029aa06b6 to your computer and use it in GitHub Desktop.
Save cjoshmartin/23b463434d587231e9f5911029aa06b6 to your computer and use it in GitHub Desktop.
#ifndef WIN32
system("CLS"); //clears screen on windows
#else
cout << "\x1b[2J\x1b[1;1H" << flush << endl; // ANSI Escape codes.
#endif // WIN32
@cjoshmartin
Copy link
Author

sample code for when you need to clear the terminal window in C

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment