Drawing an arc in C++ Graphics.h

浪子不回头ぞ 提交于 2019-12-24 14:15:55

问题


I'm using graphics.h in order to start with a bit of graphic in C++, but when I run the code the program crash. I'm using CodeBlocks as a compiler and Windows 8.1 as an operating system. What should I do in order to make it works? Here is the code:

#include <graphics.h>

int main()
{
    int gd = DETECT;
    int gm;
    initgraph(&gd, &gm, "C:\\TC\\BGI");

    arc(200, 200, 0, 130, 50);

    getch();
    closegraph();
}

回答1:


"What should I do to make it works?"

1) Forget about graphics.h it is obsolete.

2) Get yourself a modern compiler (for example; Clang 7.1, GCC 8.3 or Visual Studio 2017).

3) Pick a modern graphics library. SFML and SDL are popular options.



来源:https://stackoverflow.com/questions/54929062/drawing-an-arc-in-c-graphics-h

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!