cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Windows Programming
Replace system functions
Replace system functions
Jun 28, 2013 at 8:48am UTC
Mackan90096
(2)
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
Jun 28, 2013 at 10:03am UTC
Null
(957)
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:
http://www.cplusplus.com/articles/4z18T05o/
Jun 28, 2013 at 6:21pm UTC
anandkrishnan
(6)
just use "clrscr();" under header file conio.h to clear user screen
Jun 28, 2013 at 7:42pm UTC
andywestken
(4094)
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
http://msdn.microsoft.com/en-us/library/windows/desktop/ms682022%28v=vs.85%29.aspx
For "COLOR", see these articles
Add color to your console 2
http://www.cplusplus.com/articles/Eyhv0pDG/
and its predecessor
Add color to your console window
http://www.cplusplus.com/articles/2ywTURfi/
and maybe these posts
C++ Change CMD color background and text
http://www.cplusplus.com/forum/beginner/49203/#msg267401
http://www.cplusplus.com/user/m4ster_r0shi/
http://www.cplusplus.com/forum/beginner/21809/#msg113936
Coloured letters in output
http://www.cplusplus.com/forum/beginner/77879/#msg426847
Andy
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
Jun 28, 2013 at 7:53pm UTC
Jun 29, 2013 at 7:37am UTC
Mackan90096
(2)
Ok. Thanks for all the help!
Topic archived. No new replies allowed.