help plz

plz i want to understand this code
i want comment for each line plz
void clearscreen()
{
HANDLE hOut;
COORD Position;

hOut = GetStdHandle(STD_OUTPUT_HANDLE);

Position.X = 0;
Position.Y = 0;
SetConsoleCursorPosition(hOut, Position);
}
this code from snake game c++
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
}
Last edited on
ok, thank you very much :)
another question plz
how can i handle mouse in snake game
Is this possible
Topic archived. No new replies allowed.