Alternative to system("CLS");

hi i want a C++ function that doesn't use system and does the same thing as system("CLS") wich is to clear the screen after looping ex:
1
2
3
4
5
6
7
8
9
10
11
12
13
#include<iostream>
using namespace std;
int main()
{
char doagain;
do{
system("CLS")
cout<<"hello"<<endl;
cout<<"would u like to restart? y or n"<<endl;
cin>>doagain;
}while (doagain=='y' || doagain=='Y');
system("PAUSE")
return 0;


Copy , paste the code and compile it to see wot i want .... (i wanna replace system("CLS")
You can try couting a bunch of \r\n to clear the screen I suppose...I don't think there is a function to do that, since the console is probably different for each OS.
Topic archived. No new replies allowed.