Shvoong Home > Internet & Technology > Computers > www.shvoong.com Summary

.

Solve the Riddle and Win $500!

www.shvoong.com Website Review

Review by : kankhit
Visits : 7  words: 900   Published: February 24, 2008
GRAPHICS Program In Turbo C.How To Run It Outside The Folder ?
When we develop a program in GRAPHICS with turbo c, its not working outside the turbo folder, for that what should i do?
should i include any other code for that to work outside that folder and in any other computer

please find this function in turboc in file bgidemo.c
u can use this function in other graphics problems also

void Initialize(void)
{
int xasp, yasp;/* Used to read the aspect ratio*/

GraphDriver = DETECT; /* Request auto-detection*/
initgraph( &GraphDriver, &GraphMode, "" );
ErrorCode = graphresult();/* Read result of initialization*/
if( ErrorCode != grOk ){/* Error occured during init*/
printf(" Graphics System Error: %s\n", grapherrormsg( ErrorCode ) );
exit( 1 );
}


see the line
initgraph( &GraphDriver, &GraphMode, " " );

here u have to do changes
initgraph( &GraphDriver, &GraphMode, "c:\\tc\\bgi" );
this is called setting of path in turbo c++

in this case i have turbo c++ compiler but is also same for tuboc compiler

where c:=>drive of hard disk on which i have install turbo c++
tc=>folder in which i have all c++ folder having name bgi , bin, claslib, doc,examples,include,lib
bgi=>graphics libray necessary for graphics program

if u have installed turbo c in d: (d drive) in turboc folder then u can give path if necessary
initgraph( &GraphDriver, &GraphMode, "d:\\turboc" )
if path is not given thenalso program works provided ur file is in turboc folder
initgraph( &GraphDriver, &GraphMode, " " )

in case of turbo c++

initgraph( &GraphDriver, &GraphMode, "c:\\abc\\tc\\bgi" )
where turbo c++ is installed in abc folder within tc folder
if the path is not given in turbo c++ u get an error

please find this function in turboc in file bgidemo.c
u can use this function in other graphics problems also

void Initialize(void)
{
int xasp, yasp;/* Used to read the aspect ratio*/

GraphDriver = DETECT; /* Request auto-detection*/
initgraph( &GraphDriver, &GraphMode, "" );
ErrorCode = graphresult();/* Read result of initialization*/
if( ErrorCode != grOk ){/* Error occured during init*/
printf(" Graphics System Error: %s\n", grapherrormsg( ErrorCode ) );
exit( 1 );
}


see the line
initgraph( &GraphDriver, &GraphMode, " " );

here u have to do changes
initgraph( &GraphDriver, &GraphMode, "c:\\tc\\bgi" );
this is called setting of path in turbo c++

in this case i have turbo c++ compiler but is also same for tuboc compiler

where c:=>drive of hard disk on which i have install turbo c++
tc=>folder in which i have all c++ folder having name bgi , bin, claslib, doc,examples,include,lib
bgi=>graphics libray necessary for graphics program

if u have installed turbo c in d: (d drive) in turboc folder then u can give path if necessary
initgraph( &GraphDriver, &GraphMode, "d:\\turboc" )
if path is not given thenalso program works provided ur file is in turboc folder
initgraph( &GraphDriver, &GraphMode, " " )

in case of turbo c++

initgraph( &GraphDriver, &GraphMode, "c:\\abc\\tc\\bgi" )
where turbo c++ is installed in abc folder within tc folder
if the path is not given in turbo c++ u get an error

please find this function in turboc in file bgidemo.c
u can use this function in other graphics problems also

void Initialize(void)
{
int xasp, yasp;/* Used to read th

More reviews about the www.shvoong.com
www.shvoong.com        2008 
Please Rate this abstract : 1 2 3 4 5


Add your comment No comments

Comments & Reviews about www.shvoong.com Website Review

More summaries by kankhit

More

Read Free Summaries - Write and Get Paid

Summarize Human Knowledge on Shvoong. Join us!

------