gotoxy 原型:extern void gotoxy(int x, int y); 用法:#include <system.h> 功能:将光标移动到指定位置说明:gotoxy(x,y)将光标移动到指定行y和列x. gotoxy(0,0)将光标移动到屏幕左上角 举例: #include <system.h> main() { int i; char *scrbuf=(
gotoxy(int x, int y); 包含头文件为:#include <system.h> 功能:将光标移动到指定位置 说明:gotoxy(x,y)将光标移动到指定行y和列x. gotoxy(0,0)将光标移动到屏幕左上角.
conio.h
你好!system.h我的回答你还满意吗~~
gotoxy(x,y)是TC的函数,一般编译器没有 void gotoxy(int x, int y) { COORD pos; pos.X = x - 1; pos.Y = y - 1; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),pos); } 需加头文件#include <windows.h>#include <conio.h>
gotoxy函数在tc编译器下才能用. otoxy函数的内容: #include void gotoxy(int a,int b); int main() { gotoxy(3,3); } void gotoxy(int a, int b) { int xx=0x0b; handle houtput; coord loc; loc.x =a; loc.y=b; houtput = getstdhandle(std_output_handle); setconsolecursorposition(houtput, loc); return; }
这个函数来自于Turbo C,其他平台无此函数.
gotoxy 功 能: 在文本窗口中设置光标 用 法: void gotoxy(int x, int y); 程序例: #include int main(void) { clrscr(); gotoxy(35, 12); cprintf("Hello world"); getch(); return 0; }
stdio
如楼上所说,确是DOS时代的产物,gotoxy(x,y)移动光标到指定位置(x,y),具体实现是调用DOS中断.用TurboC编程序可以用到,其他非Borland编译器大都不支持.好像Borland最新的Turbo Explorer还是支持这个函数的. 源代码(摘自TC源