View Feed
group-icon
Coffee Room
Discuss anything here - everything that you wish to discuss with fellow engineers.
12832 Members
Join this group to post and comment.
Ankp
Ankp • Nov 30, 2008

Problem with Turbo C

guys i have a problem..i cannot use turboc compiler to compile a computer graphics program in my PC.Other C,C++ programs are run in C.But C Graphics programs are not running..i am using AMD 3600+ processor and nvidia motherboard (M2n-MX)..do any one help me with this..
😔???
Ashutosh_shukla
Ashutosh_shukla • Dec 2, 2008
You may have an error of runtime in windows if you do not specify correct path for initgraph(). Try getting correct path Remember that to specify \ you need to give \\ instead of \ . See if this works or post a small program that you cannot compile.
rajanmr
rajanmr • Dec 2, 2008
Check libraries in turboc options. Generally graphics library will be not checked. We have manually enable it by clicking on the option button.
Ankp
Ankp • Dec 5, 2008
i have give all correct paths and i have included all graphics library...
but then also it not working...i am doing line drawing algorithms in C graphics.program is compiling but when i am trying to run it. turbo C is going to be closed..
so please help me wht to do ???
Ashutosh_shukla
Ashutosh_shukla • Dec 6, 2008
I told you post your code Please if you do that may be we can help you properly.
Ankp
Ankp • Dec 7, 2008
#include
#include
#include
#include

void main()
{
int i,x=0;
int gd=DETECT,gm;
float r,y,xinc=1,yinc=0.75;
initgraph(&gd,&gm,"");
setfillstyle(1,4);
setcolor(4);
y=getmaxy()/2;
printf("\nEnter the radious=>");
scanf("%f",&r);

while(!kbhit())
{
setcolor(4);
circle(x,y,r);
floodfill(x,y,4);
if(x+r>=getmaxx())
xinc=-1.0;
if(x-r<=0)
xinc=1.0;
x=x+xinc;
if(y+r>=getmaxy())
yinc=-0.75;
if(y-r<=0)
yinc=0.75;
y=y+yinc;
delay(10);
cleardevice();
}
getch();
}


this is my program....i can compile it. but when i am going to run it, turbo c is going to close....
sumitjami
sumitjami • Dec 7, 2008
---->initgraph(&gd,&gm,"");
just replace this line by
---->initgraph(&gd,&gm,"c:\\tc\\bgi\\*.*");
make sure that all directories are properly addressed and you have and the path "c:\tc\bgi\" exists if such path does not exist then try to find some other compilor there there is no problem with your motherboard or processor.........😁
Ankp
Ankp • Dec 9, 2008
ya bro.... i know that...just forgot to write .....but when i am writing it then also its not working...




#include
#include
#include
#include

void main()
{
int i,x=0;
int gd=DETECT,gm;
float r,y,xinc=1,yinc=0.75;
initgraph(&gd,&gm,"C:\\TC\\bgi");
setfillstyle(1,4);
setcolor(4);
y=getmaxy()/2;
printf("\nEnter the radious=>");
scanf("%f",&r);

while(!kbhit())
{
setcolor(4);
circle(x,y,r);
floodfill(x,y,4);
if(x+r>=getmaxx())
xinc=-1.0;
if(x-r<=0)
xinc=1.0;
x=x+xinc;
if(y+r>=getmaxy())
yinc=-0.75;
if(y-r<=0)
yinc=0.75;
y=y+yinc;
delay(10);
cleardevice();
}
getch();
}



this is also not working...😕
Ashutosh_shukla
Ashutosh_shukla • Dec 9, 2008
i ran your code and it works just make sure that your bgi files are in correct place i dont see any reason for code not to run
sumitjami
sumitjami • Dec 9, 2008
try this.........copy all the files in the "bgi" folder in the "tc" directry and paste it in the bin folder
.......also check for the directories i.e.they should be properly addressed........if still it does not work try different compiler........

Share this content on your social channels -