VC中清屏和gotoxy()函数功能实现
#include <stdlib.h> #include <stdio.h> #include <windows.h> void gotoxy(int x, int y)//x为列坐标,y为行坐标 { COORD pos = {x,y}; HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleCursorPosition(hOut, pos); } void main() { char c; printf("???????");getchar(); system("cls"); //清屏 gotoxy(10,5);printf("a=");c=getchar(); }
|