DEV-C++怎么用gotoxy函数

gotoxy()只能在TC编译器下使用,但我用的是DEV-C++编译器,谁能讲下DEV-C++里面有什么函数可以实现gotoxy()函数的功能?或者能不能在TC编译器里的... gotoxy()只能在TC编译器下使用,但我用的是DEV-C++编译器,谁能讲下DEV-C++里面有什么函数可以实现gotoxy()函数的功能?或者能不能在TC编译器里的图形库里找到gotoxy()函数看它怎么写的然后自己写一个,做个头文件??我找不到gotoxy()怎么写的,也不知道DEV-C编译器的那个函数能实现gotoxy()这个函数的功能,唉,有点啰嗦,还请各位大虾赐教。。 展开
 我来答
匿名用户
推荐于2018-03-19
展开全部
1.DEV-CPP中没有图形函数GRAPHICS,你可以去下载SDL,专门用于游戏开发和图形设计;
具体这么做: 工具->检查更新->选择第2项检查一下->选择SDL进行更新...
2.给你看段代码参考下:(在dev-cpp4992上运行正常。)
#include
#include
#include
using namespace std;

int main( void )
{
COORD pos = { 10, 15 };
SetConsoleCursorPosition( GetStdHandle(STD_INPUT_HANDLE), pos );
SetConsoleCursorPosition( GetStdHandle(STD_OUTPUT_HANDLE), pos );
SetConsoleCursorPosition( GetStdHandle(STD_ERROR_HANDLE), pos );
cout << "这里就是第10行第15列。" << endl;

system( "pause" );
}
3。如果是4.9.6.0就好办得多.
先找到:菜单 Project-> project Options -> "General "中的 "Linker Options/Optonal Libs or Obeject files ",在下面空白处,输入: "C:\Dev-Cpp_gcc321\Dev-Cpp\lib\conio.o "
C:\Dev-Cpp_gcc321\Dev-Cpp 是我的DEV_CPP的目录,你做适当修改即可,但注意要用引号 " "括起来.
再按 "ok ",
重新编译链接即可.
对于 DEV-c++ 4.9.6.0, conio.o文件在..\lib 目录下, 4.9.7.0中没有这个文件 .
DEV-C++中没有graphics.h这个头文件
4。在dev c++中添加graphics
Dev-C++ User F.A.Q.
看到下面的步骤就可以了

How do I use Borland Graphics Interface (graphics.h)?
For those of you migrating from Borland, you may be wondering where graphics.h is. Unfortunately, graphics.h is a Borland specific library and cannot be used with Dev-C++. Fortunately, a benevolent soul by the name of Michael Main has modified a BGI emulation library for Windows applications to be used under MinGW (and therefore Dev-C++) which he has aptly named WinBGIm.

The files we need are:
graphics.h (download to C:\Dev-Cpp\include)
libbgi.a (download to C:\Dev-Cpp\lib)

将上面这两个文件下载,放入Dev-Cpp的目录,(如上)

After you have downloaded the files to the correct locations, you can now use WinBGIm's graphic.h as you would Borland's graphics.h with a few caveats.

Using library files:
First, you have to tell Dev-C++ where to find the library functions that WinBGIm references--this is done in the "Project Options" dialog box.
Here are instructions on how to do this with a new project:

创建一个工程,选择工程属性-参数,添加以下的几个连接,如图

Follow step 2 and step 3 of "Using Dev-C++".
Go to "Project" menu and choose "Project Options" (or just press ALT+P).
Go to the "Parameters" tab
In the "Linker" field, enter the following text:
-lbgi
-lgdi32
-lcomdlg32
-luuid
-loleaut32
-lole32

Project Options -> Parameters:

Click "OK".
Follow step 4, step 5 and step 6 of "Using Dev-C++".
BGI and WinBGIm differences:
WinBGIm is a superset of BGI and as such may have functions and features with which you are unfamiliar. See Michael Main's BGI Documentation for more information.

Test code:
Just to make sure you've got everything set up correctly, try this test code in a new Dev-C++ WinBGIm project:

#include

int main()
{
initwindow(400,300); //open a 400x300 graphics window
moveto(0,0);
lineto(50,50);
while(!kbhit()); //wait for user to press a key
closegraph(); //close graphics window
return 0;
}If you've done everything correctly, you should get a simple graphic that closes when the user presses a key.

最后这个是一个测试,看是否成功。
匿名用户
2013-11-10
展开全部
就是不能用的,如果想用这个,只能用TC
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式