I'm trying to make a function who clean an area on the screen. Here is my function :
void clearBuffer(CoordCR start, CoordCR end) const // Clear an area on screen
{
for (int i1 = 0; i1 < end.COLS; i1++)
{
for (int i2 = 0; i2 < end.ROWS; i2++)
{
setCursorPos(start.COLS + i1 - 1, start.ROWS + i2 - 1);
printf(" ");
}
}
}
setCursorPos is just a function who change the position of the cursor, to write ' ' character and so clear the screen. The first parameter of seCursorPos is the cols to go, the second is the row. My CoordCR struct is that :
struct CoordCR {
int COLS;
int ROWS;
};
I just give to this function the upper left point and the lower right point and she replace all character by space. This function works fine on windows but she is bugged on linux, I don't understand why. Thanks for help.