I\'ve looked everywhere for this function and cannot find the header files to make this work. It says clrscr() undeclared which brings me to the question. Is clrscr(); a fun
you have to include this header file for this function
#include <conio.h>
And before someone posts the usual "please email me the conio.h file" request, can I point out that this ancient Borland header file only contained the declaration of the function. You would also need the supporting Borland library, which will not be compatible with any modern C++ compilation system.
A web search says the header file you want is 'conio.h' - I haven't tried it out, so no guarantees. Its existence may also depend on what platform you are compiling against.
I used to do borland too.
Investigating curses is a good idea. It works on many unix platforms.
You might take a look at nconio at source forge.
This looks promising as well.
On Unix-like systems you can use VT100 escape codes.
std::cout << "\033[2J" << std::flush;
See http://www.termsys.demon.co.uk/vtansi.htm
On Linux I always use:
void clrscr(void)
{
fprintf(stdout, "\033[2J"); // clean screen
fprintf(stdout, "\033[1;1H"); // move cursor to the first line
}