Home » questions » GRAPHICS program in turbo c.How to run it outside the folder ?

GRAPHICS program in turbo c.How to run it outside the folder ?

2006-08-13 04:57:30, Category: Programming & Design
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

Answers

  1. Abhijit D

    On 2006-08-13 06:38:41


    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
  2. buddy_exotic

    On 2006-08-13 06:50:57


    Hi, Working on still turbo C. You are sweet child . When you will become grown up. Now everything shifting to 64 bit computing . you are working on 16 bit compiler. use some other compiler.
  3. RAJ V

    On 2006-08-14 03:20:42


    Use ncurses library of linux and do programs in linux