Finding a different way to clear screen

in one of my very first projects i used a function that i learned later on wasnt good to use ever.

the function was System("CLR");

i know that it is never good to use this function but i haven't been able to find a different way to achieve the same result.

the idea is that i can call the function to remove all displayed text from the screen at specified points. This will prevent the player from needing to scroll at all...

any help with this will be apprciated.
The console is not really meant for it. One way that's not too horrific is:

1
2
3
4
for (int i=0; i< number_of_lines_to_clear; ++i)
{
  std::cout << std::endl;
}


There are more :)

Also, why not read this?

http://www.cplusplus.com/forum/articles/28558/

Might give you some ideas.
yeah i haven't gotten to learning how to code a graphics game in C++ yet(in school for game programming). Have done console programming to start, just trying to get something done for my portfolio.
To answer the OP's question:
http://www.cplusplus.com/forum/articles/10515/

Enjoy!
Topic archived. No new replies allowed.