What is clreol() Function in C++?

- August 04, 2018

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.

Declaration

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:

clreol();

Example Program of clreol() Function

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

#include<canio.h>
using namespace std;
main()
{
 gotoxy(0, 19);
 clreol();
}

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 your reply.
EmoticonEmoticon

 

Start typing and press Enter to search