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! ";return 0; }