Equivalent of cls command in C++

Asked By 50 points N/A Posted on -
qa-featured

 

Is there any c++ equivalent of a "cls" command? I'm running my code as a console application. I would be very thankful if you could give me some information. 

SHARE
Answered By 0 points N/A #141419

Equivalent of cls command in C++

qa-featured

 

There are two ways to clear your screen using the program. One is by pass the cls command itself the other is by using the existing function.

By passing the command.

                System(‘CLS’);

This way you can clear the screen of your console.

By using the existing function.

Use clrscr(); function to clear the screen.

Both available methods are good enough to use in case of functionality and usability. The function is same for both of them.

The best practice of using this is by using in built methods rather than passing the command as an input.

Now it’s your choice what to use.

Related Questions