Need help setting up graphics

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2004
Posts: 10
Reputation: Emmitt310 is an unknown quantity at this point 
Solved Threads: 0
Emmitt310 Emmitt310 is offline Offline
Newbie Poster

Need help setting up graphics

 
0
  #1
Sep 29th, 2004
Hello, my name is Jonathan and I am a beginner programmer in my first year of studies. I am using a Turbo C++ editor and I'm trying to set up graphics. The problem is I'm not sure how. Here's how i was taught to set up graphics:

#include <graphics.h>

int main()
{
int graphmode;
int graphdriver = DETECT;
intitgraph (&graphdriver, &graphmode, "C:\\BGI");

Im not sure if im doing the part in quotes right...

So... can anyone please find my error? The big thing is the compiler doesnt include graphics.h
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 220
Reputation: frrossk is an unknown quantity at this point 
Solved Threads: 9
frrossk's Avatar
frrossk frrossk is offline Offline
Posting Whiz in Training

Re: Need help setting up graphics

 
0
  #2
Sep 30th, 2004
Originally Posted by Emmitt310
The big thing is the compiler doesnt include graphics.h
Change the compiler...I guess you want to use the graphic mode for DOS; for this I was using the Borland C++ 3.1 compiler.
Then, you should write
  1. intitgraph (&graphdriver, &graphmode, "C:\\BorlandC\BGI");
The part in the quotes must be the whole path to BGI folder (here, I assumed you installed Borland C on C: partition).
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 33
Reputation: letmec is an unknown quantity at this point 
Solved Threads: 2
letmec's Avatar
letmec letmec is offline Offline
Light Poster

Re: Need help setting up graphics

 
0
  #3
Sep 30th, 2004
Originally Posted by Emmitt310
Hello, my name is Jonathan and I am a beginner programmer in my first year of studies. I am using a Turbo C++ editor and I'm trying to set up graphics. The problem is I'm not sure how. Here's how i was taught to set up graphics:

#include <graphics.h>

int main()
{
int graphmode;
int graphdriver = DETECT;
intitgraph (&graphdriver, &graphmode, "C:\\BGI");

Im not sure if im doing the part in quotes right...

So... can anyone please find my error? The big thing is the compiler doesnt include graphics.h
I think you don't have graphics.h file in the correct directory. Usually it is located in the c:\\tc\\include dirct. Try to find this header file and locate it in the include diret. and in the initgraph() function write the whole path of BGI file int last argument.
like this for example
initgraph(&gd,&gm,"c:\\tc\\bgi");

first find the correct location of the files. If you donnot get the graphics.h then reinstall the turboc++.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC