#include<graphics.h>
#include<conio.h>
#include<dos.h>
void main()
{
int gdriver=DETECT,gmode,i=0,j=0;
initgraph(&gdriver,&gmode,”c:\turboc3\bgi”);
for(i;i<420;++i)
{
line(0,245,650,245);
line(0+i,200,210+i,200);
line(50+i,200,70+i,170);
line(70+i,170,140+i,170);
line(140+i,170,160+i,200);
line(85+i,170,85+i,200);
line(125+i,170,125+i,200);
line(0+i,200,0+i,230);
line(210+i,200,210+i,230);
line(0+i,230,50+i,230);
circle(65+i,230,15);
line(80+i,230,130+i,230);
circle(145+i,230,15);
line(210+i,230,160+i,230);
pieslice(65+i,230,359-j,360-j,15);
pieslice(65+i,230,179-j,180-j,15);
pieslice(65+i,230,89-j,90-j,15);
pieslice(65+i,230,269-j,270-j,15);
pieslice(145+i,230,359-j,360-j,15);
pieslice(145+i,230,179-j,180-j,15);
pieslice(145+i,230,89-j,90-j,15);
pieslice(145+i,230,269-j,270-j,15);
if(j==179)
j=0;
++j;
delay(30);
cleardevice();
}
closegraph();
}
when I try to run at borland 5.02, it say "#error BGI graphics not supported under Windows"
what the function of "c:turboc3bgi"?
Hello Mauhamad
It is the path of the bgi folder which contains the necessary files to run graphics program. This is different for different compilers, just change path "c:turboc3bgi" to correct bgi folder path and the error will be removed.
If you have further queries than let me know.
this program doesn’t execute it shows error in the initgraph(&gdriver,&gmode,”c:\turboc3\bgi”); part.
it shows undefined symbol “c”, and error in the symbol of \
Which compiler you are using? it will work only in turbo C++.
(&gdriver,&gmode,”c:\\turboc3\\bgi”); now check
What should be the path in UBUNTU compiler
please tell me how to run in codeblock when i try to run the program it says fatal error graphics .h no such file or directory
owh, i'll try to change it first.. later i'll give you a respond. thanks. 🙂
Sir, correct th path.. it should be C::\\TurboC3\\BGI
C:\\turboc3\\bgi
You have to give your BGI path
Plz change the path…
It should be “C:\\TURBOC3\\BGI”
I am using Turbo C++ 4.5 in Windows 7 and whenever I tried to run this program, it said "BGI Graphics not supported under Windows". What should I do?
Hello Subhadeep
I am not sure why this error is coming, as i have never faced such an error. There may be sum library missing or may be some other problem. In my opinion you should download turbo c++ with dos box enabled from here http://thecrazyprogrammer.blogspot.in/2013/01/download-turbo-c-for-windows-7-for-free.html
And than try to run the program, it will definitely work, as i am also using the same compiler in my computer. I hope this will help you.
This is way more helpful than anytihng else I’ve looked at.
this will not run on linux
bcoz of dos.h and conio.h is not in GCC compiler
Yes you are right bro, this will not work in linux as GCC does not have dos.h and conio.h. You can try there alternatives by searching on google. I can't help you in this case because i have very less experience of working on GCC.
bro i want some help in C programming can u plzzz help me this is my email muneebmemon5@gmail or can u give me your email i have some questions to ask about C thankx
you can ask your question, my email is sareneeru94@gmail.com
where sould I put the EGAVGA.BGI lib to in visual studio 2012 , win 7 ?
sir
i am just a student,
i want to know that why did you mentioned your email without any fear of spam?
there is no need to worry about this as my email is also mentioned on the contact us page of this blog.
nice yaar it really works
1 22 333 how to create this program? plse help me
for(i=1;i<=3;++i)
{
for(j=1;j<=i;++j)
cout<<i;
cout<<"n";
}
when i get C++ in full version for window 7 ?
#include
#include
#include
are out of date 🙂
we have error of graphics.h header file
1>d:programmingc sharpemovingcarmovingcarsource.cpp(3): fatal error C1083: Cannot open include file: 'graphics.h': No such file or directory
can help me someone?
i don't find c:turboc3bgi
who know what is that?
i am a student and want to learn please
Hello,
It is the path of the bgi folder which contains the necessary files to run graphics program.
If you have further queries than let me know.
Thankuuuu…..!!!!
I am a beginner so please make me understand this line(0,245,650,245)
can someone explain me the car program?????
#include
#include
#include
main()
{
int i, j = 0, gd = DETECT, gm;
initgraph(&gd,&gm,”C:\\TC\\BGI”);
settextstyle(DEFAULT_FONT,HORIZ_DIR,2);
outtextxy(25,240,”Press any key to view the moving car”);
getch();
setviewport(0,0,639,440,1);
for( i = 0 ; i <= 420 ; i = i + 10, j++ )
{
rectangle(50+i,275,150+i,400);
rectangle(150+i,350,200+i,400);
circle(75+i,410,10);
circle(175+i,410,10);
setcolor(j);
delay(100);
if( i == 420 )
break;
clearviewport();
}
getch();
closegraph();
return 0;
}
damn GOOD JOB
code run but screen doesn’t hold i use getch() but didn’t work
so what i do help me
awesome ….I will try …..and definetly say …that what happens…..
Hi, it’s interesting to see that someone has so much love for programming. Keep up the good work.
By the way, can your code make the car move? Have you also implemented similar program in Java?
Thank you.
It not Run! I Can’t RUN with my Turmbo C++ . why brother please tel me ?
thank you so much
hii can u pls submit me a pbl on a moving car in graphics…if u have it pls send it at my email id
if(j==179)
what it means??
hello
how can use cleardevice() in java????
has a special metod in java
Hello Neeraj, I am using DOSBox 0.74. It is showing error that undefined symbol circle,initgraph,clear device,line,pieslice and close graph. Please help to remove these errors..Please reply.
While compiling ds program it shows “code has no effect”.
WHAT CAN I DO???
That is why is there to build human thinking capacity for those who run the program, so debug it again and think as well
Hello sir my program is run. But show graphics not initialized (use ‘init graph’).
what I do please replay
function call missing ) is coming what to do
giving error in include
sir i make this program in c++ but it is not runing
no error no worning but not runing
how to make this program in c++
plz say sir
showing error at nonameoo.cpp 39: compound statement missing
Error… ‘main’ must return ‘int’
It is the error I can’t solve this one
Can anybody know?
In my computer,
#include
is showing No such file or directory, What should I do
Program is not executed,it is not even showing console screen
Can anybody explain it how it works and how to remember it all.
Hello sir .Can you send the code for moving car in opengl?