社区
C语言
帖子详情
为什么gotoxy()这个函数不能用?
bullet2003
2003-04-09 11:26:55
我为了在屏幕的中间打一行字,写了以下程序。
#include<conio.h>
#include<iostream>
using namespace std;
int main()
{
gotoxy(5,6);
cout<<"hi,world"<<endl;
return 0;
}
可是出现错误:
error C2065: 'gotoxy' : undeclared identifier
谁能解释一下为什么?
...全文
1305
6
打赏
收藏
为什么gotoxy()这个函数不能用?
我为了在屏幕的中间打一行字,写了以下程序。 #include #include using namespace std; int main() { gotoxy(5,6); cout<<"hi,world"<<endl; return 0; } 可是出现错误: error C2065: 'gotoxy' : undeclared identifier 谁能解释一下为什么?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
6 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
alexGIS
2003-04-10
打赏
举报
回复
help->index 找gotoxy;
如果找不到,就说明没有。如果找得到,又上角显示的就是你需要包含的头文件。
bullet2003
2003-04-10
打赏
举报
回复
我用的是vc6.0
bullet2003
2003-04-10
打赏
举报
回复
楼上的方法我试了,编译出错
error C2065: 'COORD' : undeclared identifier
error C2146: syntax error : missing ';' before identifier 'point'
error C2065: 'point' : undeclared identifier
error C2146: syntax error : missing ';' before identifier 'point'
error C2065: 'point' : undeclared identifier
error C2228: left of '.X' must have class/struct/union type
error C2228: left of '.Y' must have class/struct/union type
error C2065: 'SetConsoleCursorPosition' : undeclared identifier
error C2065: 'GetStdHandle' : undeclared identifier
error C2065: 'STD_OUTPUT_HANDLE' : undeclared identifier
用户 昵称
2003-04-10
打赏
举报
回复
//
// Moves the cursor to x, y in console window
// ie x=left\right y=top\bottom
//
void gotoxy(int x, int y)
{
COORD point;
point.X = x; point.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),
point);
}
explorer007
2003-04-10
打赏
举报
回复
什么编译器啊?TC?BC?VC?
andyfr1210
2003-04-09
打赏
举报
回复
在C++的库里没有这个函数。
C语言
函数
库
函数
详细介绍手册
C语言常用
函数
库详细的使用说明 字符串
函数
bcmp bcopy bzero memccpy memchr memcmp memcpy memicmp memmove memset movmem setmem stpcpy strcat strchr strcmp strcmpi strcpy strcspn strdup stricmp strlen strlwr strncat strncmp strncmpi strncpy strnicmp strpbrk strrev strset strstr strtok strupr 数学
函数
abs acos asin atan atan2 ceil cos cosh exp fabs floor fmod frexp hypot ldexp log log10 modf pow pow10 sin sinh sqrt tan tanh 输入输出
函数
getchar kbhit printf putchar 系统库
函数
ClearScreen DispBCD SetScrollBar TextOut UpdateLCD bell block clrscr cursor delay get_chi_font get_eng_font getkey getpixel
goto
xy
line move noidle outtext
xy
putpixel pyfc rectangle sleep textmode time write_chi_font write_eng_font 标准
函数
exit itoa .................
C语言
函数
速查手册
C语言常见的
函数
速查 字符串
函数
bcmp bcopy bzero memccpy memchr memcmp memcpy memicmp memmove memset movmem setmem stpcpy strcat strchr strcmp strcmpi strcpy strcspn strdup stricmp strlen strlwr strncat strncmp strncmpi strncpy strnicmp strpbrk strrev strset strstr strtok strupr 数学
函数
abs acos asin atan atan2 ceil cos cosh exp fabs floor fmod frexp hypot ldexp log log10 modf pow pow10 sin sinh sqrt tan tanh 输入输出
函数
getchar kbhit printf putchar 系统
函数
ClearScreen DispBCD SetScrollBar TextOut UpdateLCD bell block clrscr cursor delay get_chi_font get_eng_font getkey getpixel
goto
xy
line move noidle outtext
xy
putpixel pyfc rectangle sleep textmode time write_chi_font write_eng_font 系统
函数
exit itoa 字符
函数
isalnum isalpha iscntrl isdigit islower isascii isgraph isprint ispunct isspace isupper isxdigit toascii tolower toupper 内存管理
函数
calloc free malloc realloc
C语言
函数
速查
Knocker 2004.7.7 版本 0.5 字符串
函数
bcmp bcopy bzero memccpy memchr memcmp memcpy memicmp memmove memset movmem setmem stpcpy strcat strchr strcmp strcmpi strcpy strcspn strdup stricmp strlen strlwr strncat strncmp strncmpi strncpy strnicmp strpbrk strrev strset strstr strtok strupr 数学
函数
abs acos asin atan atan2 ceil cos cosh exp fabs floor fmod frexp hypot ldexp log log10 modf pow pow10 sin sinh sqrt tan tanh 输入输出
函数
getchar kbhit printf putchar 系统
函数
ClearScreen DispBCD SetScrollBar TextOut UpdateLCD bell block clrscr cursor delay get_chi_font get_eng_font getkey getpixel
goto
xy
line move noidle outtext
xy
putpixel pyfc rectangle sleep textmode time write_chi_font write_eng_font 系统
函数
exit itoa 字符
函数
isalnum isalpha iscntrl isdigit islower isascii isgraph isprint ispunct isspace isupper isxdigit toascii tolower toupper 内存管理
函数
calloc free malloc realloc
迷宫求解 通过对数据结构半年的学习,做了这个程序,希望给大家带来方便。
注释一:你能看见迷宫几乎完全是随机的,但为了保证一定有一条通道,我在起点和终点附近各放了九个可以通行的点。不算作弊吧。 注释二:循环里面的延时对于PENTIUM几乎一点作用都没有。所以运行时你或者选用 STEP,或者把延时提高一点,才能看清是如何迈向前途未卜的新一步,又是如何迷途知返,重新审视自己的步伐。 注释三:这个程序的技巧很好,但完全没有注释,风格也不太好,但这正是几年前我的标准的程序,所以现在我也不改,直接拿出来,仅供一娱。 注释四:程序用TC才能编译。VC,标准C中没有“
goto
xy
”等
函数
。当然,这只影响界面显示,不影响我们行走的算法。
snake_游戏_
1.游戏界面这个小游戏游戏界面的核心在于光标的控制。只要我们能让光标到达我们想要的地方,我们就能完成游戏界面的绘制,蛋的生成。简直就像天上地下,无所
不能
。实现:
goto
xy
()
函数
2.游戏体验感如何将用户的输入读入,而不显示在屏幕上?实现:getch()
函数
(包含在<conio.h>中)如何防止用户的非法输入?玩游戏的过程中难免会摁到其他的键,如何让它不影响到我们的游戏?如果蛇在往前行走,我们控制方向向后,该怎么处理?实现:保存蛇的前进状态。
C语言
69,396
社区成员
243,080
社区内容
发帖
与我相关
我的任务
C语言
C语言相关问题讨论
复制链接
扫一扫
分享
社区描述
C语言相关问题讨论
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章