i am beginner in c++ programming and when i was just practicing i used the function(i think its a function) clrscr(); and it showed error as "its not declared in scope". What should I do to avoid this error and clear my screen.
I cant use clear screen function in my program when using code blocks
Post a Reply
|Oldest Newest Rating|
Bernard Pyc0d333 Parah
· December 29, 2014
if you are using windows the command is system("cls");
i did this example on linux since that is what i use.
· January 2, 2015
Use the header :
Then where you wanna clear the screen, use
system( "cls" );
Tell me if it works!
· January 3, 2015
As stated by Krootashus, C++ does not have any formal portable method of clearing the screen.
It's OS dependant. On Windows, you'd have to use the WIn32 API to do it, or simply make a system call. I'd avoid system calls because of the heavy resource usage underneath. If you are wanting to use the API,
look into these two functions.
Used in many types of software including music players, video games, and many large scale applications.
|Bucky Roberts Administrator|