English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

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

2006-08-13 00:57:30 · 3 answers · asked by aswath 1 in Computers & Internet Programming & Design

3 answers

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

2006-08-13 02:38:41 · answer #1 · answered by Abhijit D 3 · 0 0

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.

2006-08-13 09:50:57 · answer #2 · answered by Anonymous · 0 1

Use ncurses library of linux and do programs in linux

2006-08-14 06:20:42 · answer #3 · answered by RAJ V 1 · 0 0

fedest.com, questions and answers