+ 3
Please tell me about clrscr in c++
4 Réponses
+ 27
It is a predefined function, by using this function we can clear the data from console . Use of clrscr() is always optional but it should be place after variable or function declaration only.
+ 1
"It is a predefined function in "conio.h" (console input output header file) used to clear the console screen.
It is a predefined function, by using this function we can clear the data from console (Monitor).
Using of clrscr() is always optional but it should be place after variable or function declaration only."
example:
#include<iostream.h>
#include<conio.h>
void main()
{
int a=10, b=20;
int sum=0;
clrscr(); // use clrscr() after variable declaration
sum=a+b;
cout<<"Sum: "<<sum;
}
according to sitesbay.com
https://www.sitesbay.com/cpp/cpp-clrscr()-and-getch()
+ 1
clrscr() is used to clear command window before executing the current code in the window