gotoxy

gotoxy

gotoxy是一種計算機用語,原型是extern void gotoxy(int x, int y),功能是將游標移動到指定位置,用法是#include <system.h>。

基本介紹

  • 外文名:goto_xy
  • 原型:extern void gotoxy
  • 用法:#include <system.h>
  • 功能:將游標移動到指定位置說明
功能,舉例,使用環境,

功能

游標移動到指定位置說明:gotoxy(x,y)將游標移動到指定行x和列y。設定游標到文本螢幕的指定位置,其中參數x,y為文本螢幕的坐標。
gotoxy(0,0)將游標移動到螢幕左上角。

舉例

e.g.1
#include <system.h>int main(){int i;char *scrbuf=(char *)0x280;for(i=0;i<85;i++) scrbuf='+';UpdateLCD(0x00);gotoxy(2,2);getchar();move(2,2);getchar();return 0;}
e.g.2:
下面這個例子將在螢幕中央輸出“hello world”
#include <conio.h>int main(void){clrscr();gotoxy(35, 12);cputs("Hello world");getch();return 0;}

使用環境

gotoxy僅在及BC下可以使用。

相關詞條

熱門詞條

聯絡我們