un grazie a pierotofy per la parte dell'HANDLE
- Code: Select all
#include <stdio.h>
#include <windows.h>
int main()
{
int x, y;
printf("\nSetConsoleCursorPosition");
while(1)
{
x = rand() % 50;
y = rand() % 50;
COORD CursorPos = {x, y};
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hConsole, CursorPos);
printf("X(%d,%d)", x, y);
Sleep(50);
printf("\b\b\b\b\b\b\b\b ");
}
}
