I am unable to run even a simplest graphics program in C, even though when i compile the program it shows success but when i run it , it gives the error that the BGI error: graphics not initialized... I dont know where is the problem...can any one help plz #include<stdio.h> #include<conio.h> #include<graphics.h> void main() { int gd=DETECT,GM; initgraph(&gd,&gm,""); setbkcolor(RED); getch(); }
try this this one will be ok #include<stdio.h> #include<conio.h> #include<graphics.h> void main() { int gd=DETECT,gm; initgraph(&gd,&gm,""); setbkcolor(RED); getch(); }
Have already tried this , but its till not working. Is there any problem in the initialization of graphics driver in my system??
Maybe you can try to specify the path of the bgi folder : Initgraph(&gd,&gm,"[put the path here : c:\\...]");