Hey, I'm brand new to this site. Hopefully someone can help me out.
How do you clear the console screen without any system-compatibility issues?
This means that SYSTEM("CLS") and anything from a windows library (like #include<windows.h>) is not acceptable, as it will not run on linux/unix etc...
I know theres some tweaks you can do to linux which would make this work, but this is for a computer engineering course, and it has to run on everything.
I've created a function that looks something like this:
void CLS()
{
for (int iLoop = 0; iLoop < 40; iLoop++)
{
cout << " ";
}
return 0;
}
While this does pseudo-solve my problem, it leaves the text on the bottom of the console screen rather than the top, and you can just scroll up to see the previous output. It seems a little redundant to clear the screen in the console, but I need it for a lab at school. Although I don't think anyone else in my class has figuired out how yet...
Thanks.