Hello
Please tell me how can I used CLS in C++.. In any programm. ?

Recommended Answers

In linux you would use the "clear" command unless you create an alias for it.

Jump to Post

All 3 Replies

//ThisProgram is about CLS,A Command Prompot 
//Command used to Clear the screen

#include<iostream>
using namespace std;

int main()
{
    cout<<"Hello World!!";
    system("cls");
    cout<<"How Are You ";
    cin.get();
    return 0;
}

In linux you would use the "clear" command unless you create an alias for it.

This is highly dependant on the OS you're targeting and how you're interacting with the console. Anything beyond the standard streams is pretty non-portable unless you use an external library.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.