There are two ways to run C graphics program in Dev-C++:
2) Download WinBGIm 6.0 Dev-C++ package from
2) Download WinBGIm (http://winbgim.codecutter.org/)
3) Extract the zip file.(Contains graphics.h winbgim.h and libbgi.a)
4) Copy graphics.h and winbgim.h files in include folder(C:\Dev-Cpp\include\) of your compiler directory.
5) Copy libbgi.a to lib folder (C:\Dev-Cpp\lib\) of your compiler directory.
6) Now Open Dev-C++ and create a new project. (Go to File-> New-> Project-> Project Name(my_first_gproject)->Ok)
7) Go to Project Menu->Project Options->Parameters
8) Copy the following code in the Linker field and click ok.
-lbgi
-lgdi32
-lcomdlg32
-luuid
-loleaut32
-lole32
9) Add a new file(first.c) to the project
10) Write the following code on first.c file:
#include <conio.h>
#include<graphics.h>
>>To know more about C graphics program, you may visit the following links:
!!!Happy Programming!!!
First Process:
1) Download (http://bloodshed-dev-c.en.softonic.com/) and install Dev-C++.2) Download WinBGIm 6.0 Dev-C++ package from
(http://www.nextwap.net/file/sRPS3XPN/winbgim-60-1g17l.html)
3) To Install WinBGIm 6.0 Dev-C++ package, go to Tools->Package Manager
Then Click ->Install Package->Add WinBGIm 6.0 Dev-C++ Package->Open->Next->Finish
4) Go to File->New->Project->Select WinBGIm->Project Name(my_first_gproject)->Ok
3) To Install WinBGIm 6.0 Dev-C++ package, go to Tools->Package Manager
Then Click ->Install Package->Add WinBGIm 6.0 Dev-C++ Package->Open->Next->Finish
4) Go to File->New->Project->Select WinBGIm->Project Name(my_first_gproject)->Ok
int main()
{
int gDriver=DETECT, gMode, midx=0,midy=0;
{
int gDriver=DETECT, gMode, midx=0,midy=0;
initgraph(&gDriver, &gMode, " ");
midx=getmaxx()/2;
midy=getmaxy()/2;
line(0,midy,getmaxx(),midy);
line(midx,0,midx,getmaxy());
circle(midx, midy, 100);
getch();
closegraph();
return 0;
}
6) Compile and run the program.
midx=getmaxx()/2;
midy=getmaxy()/2;
line(0,midy,getmaxx(),midy);
line(midx,0,midx,getmaxy());
circle(midx, midy, 100);
getch();
closegraph();
return 0;
}
Second Process:
1) Download (http://bloodshed-dev-c.en.softonic.com/) and install Dev-C++.2) Download WinBGIm (http://winbgim.codecutter.org/)
3) Extract the zip file.(Contains graphics.h winbgim.h and libbgi.a)
4) Copy graphics.h and winbgim.h files in include folder(C:\Dev-Cpp\include\) of your compiler directory.
5) Copy libbgi.a to lib folder (C:\Dev-Cpp\lib\) of your compiler directory.
6) Now Open Dev-C++ and create a new project. (Go to File-> New-> Project-> Project Name(my_first_gproject)->Ok)
7) Go to Project Menu->Project Options->Parameters
8) Copy the following code in the Linker field and click ok.
-lbgi
-lgdi32
-lcomdlg32
-luuid
-loleaut32
-lole32
9) Add a new file(first.c) to the project
10) Write the following code on first.c file:
#include<stdio.h>#include
#include<graphics.h>
int main()
{
int gDriver=DETECT, gMode, midx=0,midy=0;
initgraph(&gDriver, &gMode, " ");
midx=getmaxx()/2;
midy=getmaxy()/2;
line(0,midy,getmaxx(),midy);
line(midx,0,midx,getmaxy());
circle(midx, midy, 100);
getch();
closegraph();
return 0;
}
11) Compile and run the program.
>>To know more about C graphics program, you may visit the following links:
1 comment:
Thank you.
Post a Comment