Please try to put code in code tags. They show up as "<>" in the format box
1 2 3 4 5 6 7 8 9 10 11 12 13
void clearscreen() // define the clearscreen function
{
HANDLE hOut; // declare a HANDLE object
COORD Position; // declare a COORD object
hOut = GetStdHandle(STD_OUTPUT_HANDLE); // call the GetStdHandle function
// and assign return value to hOut (your HANDLE object)
// Assign the X and Y coordinates of your COORD object
Position.X = 0;
Position.Y = 0;
SetConsoleCursorPosition(hOut, Position); // Call the SetConsoleCursorPosition function
}