gpt4 book ai didi

c - Gotoxy(int x,int y) 的使用

转载 作者:行者123 更新时间:2023-11-30 19:19:10 25 4
gpt4 key购买 nike

我是C语言新手,gotoxy函数有什么用?我读到它只能在控制台中使用。这是什么意思?有人可以给我一个以合法方式使用它的例子吗?

最佳答案

您的 Google 技能很弱。尝试“gotoxy conio man”:http://code-reference.com/c/conio.h/gotoxy .

gotoxy

void gotoxy(int x, int y);

places cursor at a desired location on screen.

示例代码:

#include <stdio.h>
#include <conio.h>

int main( void )
{
int x, y;
x = 42;
y = 42;
clrscr();
gotoxy(x, y);

printf("gotoxy jumps to cursor position x42 y42.");

getch();
return 0;
}

关于c - Gotoxy(int x,int y) 的使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25328939/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com