hi i have problems running this program :
Code:
#include <graphic.h>
#include <stdlib.h>
#include <conio.h>
int main (void)
{
/* request auto detection */
int gdriver =DETECT,gmode,errorcode;
int xmax,ymax;
/* intialize grafics and local variables */
initgraph(&gdriver,gmode,"");
/* read result of initialization*/
errorcode = graphresult();
/* if an error ocurred */
if (errorcode !=gr0k)
{
printf("Grephics error:%s \n",grapherrormsg(errorcode));
printf("press any key to halt:");
getch();
exit(1);
}
setolor(getmaxcolor());
xmax= getmaxx();
ymax = getmaxy();
/*draw diagonal line*/
line (0,xmax,ymax);
/*clean up*/
getch;
closegraph();
return 0;
}
when i try to running it appears this error :
11 D:\aspel\koi.cpp `DETECT' undeclared (first use this function)
im using DEV-C++
WHAT AM I DOING WORNG =?? i tried with visual c++ but it says:
fatal error C1083: Cannot open include file: 'graphic.h': No such file or directory
Error executing cl.exe.
i dont even know how to install the graphic.h library please help
than you in advanced