Created
November 3, 2011 18:13
-
-
Save fpersson/1337246 to your computer and use it in GitHub Desktop.
Clear screen i C/C++ for unix/windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @warning Funktionen fungerar bara i windows/linux, | |
* dock bör linux varianten fungera med alla *NIX varianter | |
* efter som vi inkluderar unistd.h (finns denna i MacOS X?) | |
*/ | |
void ClearScreen() | |
{ | |
#ifdef __linux__ | |
/** @note Rensar skärmen och sätter markören överst */ | |
printf("\033[2J"); | |
printf("\033[0;0f"); | |
#else | |
//system("CLS"); | |
clrscr(); //ej testat | |
#endif | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment