夏钺的博客

一条咸鱼

windows.h头文件中改变光标位置的函数——SetConsoleCursorPosition

COORD
具体为
typedef struct COORD{
          short X;
          short Y;
          }
COORD,*PCOORD;

 

 
 
可以用来记录坐标.
#include <iostream>
#include <windows.h>
using namespace std;
int main(void)
{
    HANDLE consolehwnd; 
    consolehwnd = GetStdHandle(STD_OUTPUT_HANDLE); 
    cout<<"hello ";
    SetConsoleTextAttribute(consolehwnd,FOREGROUND_INTENSITY | FOREGROUND_GREEN);
    cout<<"world!\n";return 0;
}

 

posted @ 2020-04-23 16:58  Applied_Energetic  阅读(428)  评论(0编辑  收藏  举报