c - C光标问题

扫码查看

我是涡轮C的新手。。。只想问一下我应该做什么来启用游标。我想控制光标并重新定义键盘上的键。请给我台阶,提前谢谢!

最佳答案

当恐龙统治地球和一些专业程序员实际使用Turbo C时,光标支持是通过名为conio.h的include文件中的例程来处理的。
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 - C光标问题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/6289571/

10-14 17:45
查看更多