Replace system functions

Hi there! I'm kind of new to C++ and I'm wondering:

Is there any way to replace the system functions?

Like the system("CLS") and system("COLOR") ?

If there is, how do I do it?

Thanks // Mackan90096
There are many ways but there's no standard way. You can use libraries such as ncurses, or use system-specific functions.

Check out this article for how to clear console screen:

just use "clrscr();" under header file conio.h to clear user screen
The article Null pointed you at already provides an example of "CLS", including the Win32 approach.

Microsoft also provide a similar example:

Clearing the Screen

For "COLOR", see these articles

Add color to your console 2

and its predecessor

Add color to your console window

and maybe these posts

C++ Change CMD color background and text

Coloured letters in output


PS @ anandkrishnan

There's no clrscr in the conio.h that's provided with Visual C++. Nor in the one provided with the MinGW version of GCC. To the best of my knowledge, clrscr is unique to Borland's C runtime library.
Last edited on
Ok. Thanks for all the help!
Topic archived. No new replies allowed.