how to use header file "graphics.h" in C?

how to use header file "graphics.h" in C?

sanjay sharma
Views: 2293 | Community Opinion: 1



Bookmark this page..



Ask a New Question Go to Home

Community Opinion/Answers
 
John Deter Said..

Here is a sample program in C that tell how to use graphics.h header file


#include
#include
#include

void main(void)
{
int driver = DETECT,mode;
int x[10],y[10];
int x_center = 360, y_center = 180, rad = 100;
int i,j;

initgraph(&driver,&mode,"c:\\tc\\bgi");
for ( i = 0; i < 10; i++ )
{
x[i] = x_center + rad * cos(36*i*3.14159/180);
y[i] = y_center + rad * sin(36*i*3.14159/180);
}
for ( i = 0; i < 10; i++ )
for ( j = 0; j < 10; j++ )
line(x[i],y[i],x[j],y[j]);
getch(); /* press any key return to TEXT mode */
closegraph();
}






What do you think? Add your opinion/answer
*Name
*your opinion/answer: