Clear Screen

How do I clear the console screen? I tried all the ways, nothing works. clrscr() does not. I need it VERY urgent, it's killing me. Someone HELP.
ujikolAsked:
Who is Participating?
 
GEM100Connect With a Mentor Commented:
First of all, clrscr(); is working in DOS, but not for console window.
Well, because there is no Win32 API you can use system function:

#include <stdlib.h>
#include <iostream.h>
void main()
{
system("cls");
}

You can also write a function to programmatically clear screen, but this should also work.
0
All Courses

From novice to tech pro — start learning today.