วันเสาร์ที่ 29 มกราคม พ.ศ. 2554

gotoxy()

ฟังก์ชัน gotoxy()
เป็นฟังก์ชันที่ใช้สำหรับกำหนดตำแหน่งเคอร์เซอร์บนจอภาพ บนจอภาพแบบเท็กซ์โหมด

รูปแแบ

gotoxy(column,row);


โดยที่

column คือ สดมภ์ซึ่งมีค่าได้ตั้งแต่ 0 ถึง 79
row คือแถว ซึ่งมีค่าได้ตั้งแต่ 0 ถึง 24

ตัวอย่าง

#include
int main (void){
gotoxy(24,1);
printf("This is a message #1");
system("pause");

}



#include
int main (void){
gotoxy(24,10);
printf("This is a message #2");
system("pause");

}



#include
int main (void){
gotoxy(29,11);
printf("The end");
system("pause");

}

ไม่มีความคิดเห็น:

Popular Posts