+ 4
How do you clear the screen in modern c++?
I had came up from Turbo C++, which isn't a good compiler to use now, but now I am having problem clearing the screen away! In Turbo, I had used clrscr() function from <conio.h> library and it worked perfectly. However it does not work in modern compilers. Will anyone help me?
3 Réponses
+ 4
@Jamie
Will 25 '\n' work?
+ 3
@Jamie
Thanks!
+ 1
Late but here is something
void clearScreen()
{
#if defined(WIN32) || defined(__WIN32) || defined(__WIN32__)
system("cls");
#else
system("clear");
#endif
}