我尝试的是......我正在编写代码来打印所有 c 语言字符集 ASCII 代码 [0-255] 以及字符(256)!正如我们在 C 中所知道的,函数声明或头文件声明是可选的!
void main()
{
int i = 0;
char c1, c2;
printf("ASCII code\tCharacter\n");
printf("----------\t---------\n");
//printing
while (i <= 255)
{
printf("%d\t%c\n", i, i);
i += 1;
}
/*
my code to move the cursor in console screen
using up & down arrows!
ASCII codes of up & down arrows are(0 & 72) & (0 & 80)
when i press any other non-data key it comeout from program!
*/
c1 = getch();
while (c1 == 0)
{
c2 = getch();
if (c2 == 72)//up arrow
gotoxy(wherex(), wherey()-1);
else if (c2 == 80)
gotoxy(wherex(), wherey()+1);
else //any other key
break;
c1 = getch();
}
}
在 turbo-C IDE 中,我只能看到最后一个控制台屏幕,并且我只能在该 1 页控制台屏幕内移动光标!我需要做的是我想从第 0 个 ASCII 开始看到!
我在 turbo-C IDE 中得到的是......
我也在使用 Borland-C++ 5.02 IDE。在那个IDE中我什至不能移动光标!但我确信 gotoxy()、wherex()、wherey() 函数在该 Borland-C++ IDE 中工作。因为我已经通过编写一小段代码进行了检查,只接受箭头键和功能也可以正常工作。实际上我是 C/C++ 的新手。只是为我的练习制定高级水平!
然后,我为我的 windows7 操作系统下载了以下 C/C++ IDE。
<Dev-C++ 5.4.0 verion IDE>.
当我使用这些功能时,在那个 IDE 中......
gotoxy(), wherex(), wherey()
对“gotoxy”、“wherex”、“wherey”链接器错误的未定义引用。
我在这个网站上看到了一个问题。我被指示从http://conio.sourceforge.net/下载最新的头文件 ,我得到了同样的错误!
任何人都可以建议我吗?我只是愿意写一些有趣和棘手的控制台屏幕程序。 寻求帮助,如何为 dev-C++ IDE 或代码块 IDE 添加外部 conio 库?请提供给我完整的详细信息!我必须在 turbo-C++ IDE 之外需要解决方案,最好是用于 WINDOWS7 操作系统的 DEV-C++ 或 CODE-BLOCK-IDE!为我提供更多帮助!提前致谢