# C graphics wont work on my pc



## srishet (Apr 29, 2010)

Hello

I have an issue C graphic programming. I have simple circle drawing program. You can view the program code at: *testsrikanth.ipower.com/CIRCLES.txt .    I m using Borland C 3.0 version. When I compile it doesn't have any errors. However, When I Run the program, it show blank window and close automatically. Please help me how to run graphics in C program. I am using Atom processor. 

Thanks 
Srikanth Shet


----------



## anuvrat_parashar (Apr 30, 2010)

which operating system are you using ?
if its newer than windows xp .. I am afraid you won't be able to run the code.
but if you are using xp ... 
the problem could / should be in the path specified in initgraph(&gd, &gm,"")
the thing under quotes is supposed to be 
"c:\\tc\\bgi" if your bgi (borland graphics) files are in this directory. 

P.S change the path accordingly. It should work.

hope this helps


----------



## srishet (Apr 30, 2010)

I am using Windows XP SP3 Operating System. Could you please tell me how to change the path. I m using Boraland C and it is installed on D:\ drive. However, I have changed the directories of Library, output, include in the Option Menu of C program.


----------



## anuvrat_parashar (May 1, 2010)

xp .. every thing should work fine.
borland C 3.0 .. isn't it called Turbo C++ 3.0?
anyways .. for making things work, as I have already told you. you just need to change the third parameter of the initgraph function. This is what your function should look like:


```
initgraph(&gdrive,&gmode,"d:\\tc\\bgi");
```
 
the job of the third parameter is to indicate the location of borland graphics interface (bgi) files, mainly egavga.bgi (the driver)

if you don't want to make this change you may also copy the files present in \\bgi folder to the output folder .. (probably the \\bin folder)

this should make it work


----------



## srishet (May 1, 2010)

Thank you very much sir. I really appreciated. It works. I just copied the file egavga.bgi to Bin Folder. Once again thank you sir.


----------



## anuvrat_parashar (May 1, 2010)

if in future you would like to incorporate graphical fonts in your 16 bit program .. then copy the font file too to the output directory.

and you're welcome ... anytime


----------

