Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: r0x on August 16, 2010, 03:00:43 pm
-
Hi there! How should I run this code? Which type of project do I need? Thanx!
/* Sample program to draw a circle*/
#include<graphics.h>
#include<conio.h>
main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,""); /* initialization of graphic mode */
circle(150,150,100);
getch();
closegraph(); /* Restore orignal screen mode */
}
/* End of program */
-
Where did you copy these code snippet?
It seems it is for old BGI library of "Turbo C 2.0 " or "Borland C++" compiler. (It's an old compiler in the last centry :D)
So, I suggest you can
1, learn to use a new graphics library, like wxWidgets or others...
2, learn to use a BGI library for MINGW, see WinBGIm - Borland BGI emulation for MingW (http://codecutter.org/tools/winbgim/)
Good luck!!!