Social Icons

twitterfacebookgoogle pluslinkedinemail

Tuesday 13 August 2013

graphics header file in C language

<graphics.h>
 this is the header file in C language.which gives  facility for drawing graphics.


initgraph function is inbuilt function in graphics.h header file that use for initializing graphics.

a simple draw line program for c language.

#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main()
{
int gd = DETECT;

initgraph(&gd,0,"c:\\tc\\bgi");
line(10,10,10,100);
getch();
}



initgraph's syntax says first parameter is for detecting graphics from your PC,
second parameter is allocating the background size,and the last parameter
is path of your graphics directory.

No comments :

Post a Comment

 

Free Advertisement

Free Advertisement

Free Advertisement

Free Advertisement