中国开发网: 论坛: 程序员情感CBD: 贴子 65379
MaoMao
给你个例子。。。
#include <windows.h>
#include <iostream>
using namespace std;

void gotoxy( short x, short y ) {

HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
COORD position = { x, y };

SetConsoleCursorPosition( hStdout, position );
}

int main() {

cout << "top left" << endl;
cout << "next line";

gotoxy(30, 2);

cout << "top left again";

return 0;
}

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录