c++ - C 和 C++ 中的图形

标签 c++ c bgi

在 Turbo C 3.2 中,我得到了

Divide error

在代码块 IDE 中我收到错误

initgraph() and closegraph() are refrence at compile time. (I added graphics header and library file in folder of codeblocks).Please give me solution?

我写的代码是

#include<graphics.h>
int main()
{
   int a=10,ab;
   initgraph(&a,&ab,"C:\\TURBOC3\\BGI");
   circle(100,200,20);
   closegraph();
   return 0;
 }

最佳答案

除了路径中的反斜杠问题之外,您使用 3270 兼容显示器的可能性。为什么不用a=0传入a的地址呢。 ab 必须设置为请求的模式,除非您将驱动程序设置为自动检测,然后它将选择最高的可用模式。请参阅here .

关于c++ - C 和 C++ 中的图形,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48076571/

相关文章:

c++ - gcc 不会编译缺少的 sys/cdefs.h

c++ - "A is nested class in B"是可传递的关系吗?

c++ - size_t 是字长吗?

c - setbkcolor() 在 Dev-C++ 4.9.9.2 中无效

c - 图形(二维旋转)

c++ - 根据 C++ 中动态生成的数字对列表进行排序

c++ - 在 QThread 中启动 QTimer

c - 使用 write() 打印 stat 结构时出错

C Sock 编程中的 Accept 问题

c++ - 带图形的 c/c++ 赛车游戏