gotoxy()函数,需自己定义。
#include <stdio.h>
#include <windows.h>
void gotoxy(short x,short y) {
COORD pos={x,y};
HANDLE hOut=GetStdHandle(STD_OUTPUT_HANDLE); //获取标准输出设备句柄
SetConsoleCursorPosition(hOut,pos); //这个函数定位hOut中的光标位置,两个参数分别是指定哪个窗体,具体位置
}
int main()
{
int x,y;
gotoxy(10,10);
printf("hello,world!");
return 0;
}
关于COORD: