C语言如何确定光标的位置

来源:百度知道 编辑:UC知道 时间:2024/05/25 01:56:12
c++里面是用的 gotoxy c里面用什么呢?

void gotoxy(int a,int b){
int x=0x0b;
HANDLE hInput, hOutput;
COORD loc;
loc.X = a; loc.Y=b;
hOutput = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hOutput, loc);
}
在vc上没有gotoxy,但可以用SetConsoleCursorPosition代替,这是我用过的函数,自己定义的,可以用