void go(int x, int y)
{
COORD c;
c.X = x-1;
c.Y = y-1;
SetConsoleCursorPosition (GetStdHandle(STD_OUTPUT_HANDLE), c);
}
VC中用,只知道这函数能移动坐标
帮忙解释下
void go(int x, int y)
{
COORD c;
c.X = x-1;
c.Y = y-1;
SetConsoleCursorPosition (GetStdHandle(STD_OUTPUT_HANDLE), c);
}
VC中用,只知道这函数能移动坐标
帮忙解释下
SetConsoleCursorPosition将光标移到c位置,而函数把x,y
作为参数传入,又做了 c.X = x-1; c.Y = y-1;所以光标将实现退格。
GetStdHandle
回答得很好啊