What is clreol() Function in C++?

The word “clreol” is the short of clear end of line. The clreol function is used to clear a line from the currunt cursor position up to the end of line. It clears all characters from the cursor position, the other text printed on the screen is not cleared.


In C++, the declaration of clreol() function as looks like this:

void clreol(void);

The declaration of this function indicates that no parameter is passed to this function. This function returns no value. The general syntax to call this function is as follows:


Example Program of clreol() Function

This following C++ program clears the line number 20 from first column to the last column.

using namespace std;
gotoxy(0, 19);

In this program, first statement (gotoxy) shifts the cursor at the first column of line number 20. The second statement clears this line up to the end of line.

Summary of Clreol

The following chart illustrates the summary of tutorial of c++ clreol function.

clreol in cpp Note: This function should not be used in Win32 GUI applications.

Leave a comment

Your email address will not be published. Required fields are marked *