gpt4 book ai didi

C 光标问题

转载 作者:太空宇宙 更新时间:2023-11-04 01:40:27 26 4
gpt4 key购买 nike

我是 Turbo C 的新手...只是想问一下启用游标我应该做的第一件事是什么。我也想控制光标并重新定义键盘上的键。请给我步骤,在此先感谢!

最佳答案

当恐龙统治地球并且一些专业程序员实际使用 Turbo C 时,光标支持是通过名为 conio.h 的包含文件中的例程处理的。

http://en.wikipedia.org/wiki/Conio.h

您不会找到很多关于此的互联网时代文章。但我设法在 an online document 中找到了对使用它的人的引用:

/* Program to display text using special functions*/
#include <conio.h>

main (){
int n,m,;

/* clears the screen */
clrscr ( );

/* sets the text mode to 80 columns color*/
textmode (3);

/* SETS THE TEXT COLOR*/
textcolor (4);

/* sets the text background color */
textbackground (2);

/* Positions to 5th row and 14th column*/
gotoxy (5,15);
printf ("Enter two numbers:");
scanf ("%d %d", &n, &m);
gotoxy (10,15);
printf ("Entered numbers are %d and %d \n\n", n,m);
}

不清楚您的意思是不是要重新定义键,以便在您的程序运行时,当用户按下某个键时,它会产生不同的字符输出。如果是这样,您可能希望使用类似 bioskey() 的东西...因为 getch() 只读取字符,而不是功能键或修饰符之类的东西:

http://www.softwareandfinance.com/Turbo_C/bioskey.html

关于C 光标问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6289571/

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