原型:extern void gotoxy(int x, int y);
用法:#include
功能:將 游標移動到指定位置說明:gotoxy(x,y)將游標移動到指定行y和列x。設置 游標到文本屏幕的指定位置,其中參數x,y為文本屏幕的坐標。
gotoxy(0,0)將游標移動到屏幕左上角
程序舉例1:
#include
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;
}
程序舉例2:
下面這個例子將在 屏幕中央輸出「hello world」
#include < conio.h>
int main(void)
{
clrscr();
gotoxy(35, 12);
cputs("Hello world");
getch();
return 0;
}
gotoxy僅在TC及BC下可以使用。
用法:#include
功能:將 游標移動到指定位置說明:gotoxy(x,y)將游標移動到指定行y和列x。設置 游標到文本屏幕的指定位置,其中參數x,y為文本屏幕的坐標。
gotoxy(0,0)將游標移動到屏幕左上角
程序舉例1:
#include
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;
}
程序舉例2:
下面這個例子將在 屏幕中央輸出「hello world」
#include < conio.h>
int main(void)
{
clrscr();
gotoxy(35, 12);
cputs("Hello world");
getch();
return 0;
}
gotoxy僅在TC及BC下可以使用。