C语言光标移动

这个是我在做面试题第一题的时候折腾出来的。

——————————-分割线————————————

这里用到了windows.h

int move_cur(int x,int y)  //移动光标到X,Y
{
        HANDLE hOut;
        COORD pos= {x, y};
        hOut = GetStdHandle(STD_OUTPUT_HANDLE);
        SetConsoleCursorPosition(hOut, pos);
}

其实说白了我自己也看不懂这个代码是什么意思。。反正用到了某个API。。汗,先Mark在这里吧。。等以后看得懂了再来挖坟写掉。


原文地址:https://www.cnblogs.com/wuhenqs/p/2846652.html