Functions like gotoxy,delay,textcolor in c++ working in turbo C++ but not in dev c++

Status
Not open for further replies.

aashish473

Right off the assembly line
There are a few functions like gotoxy,delay,textcolor,clrscr and many others which run perfectly in turbo C++ but don't work at all in dev c++. I tried copying header files from turbo c++ directory into devC++ directory, but it makes things worse. Plz help.
 

Faun

Wahahaha~!
Staff member
Re: Functions like gotoxy,delay,textcolor in c++ working in turbo C++ but not in dev

Because Turbo C hates us :p
 

QwertyManiac

Commander in Chief
Re: Functions like gotoxy,delay,textcolor in c++ working in turbo C++ but not in dev

There are a few functions like gotoxy,delay,textcolor,clrscr and many others which run perfectly in turbo C++ but don't work at all in dev c++. I tried copying header files from turbo c++ directory into devC++ directory, but it makes things worse. Plz help.
They are part of Turbo's own Windows-specific library functions. You can't find them in most other compilers like mingw32 (Dev-C++) which has a cross-platform library.
 
Re: Functions like gotoxy,delay,textcolor in c++ working in turbo C++ but not in dev

^Those are not actually windows specific, but are borland specifc. Buddy, actually when you use the graphics routine provided in turbo C++, you are using what is know as Borland Graphics Interface. It is specific to borland compilers and wont be available in others. Standard C++ or C does not defines any graphics library as standard. So Borland created BGI for use with DOS based machines for simple graphics functionality. On Windows, GDI, Direct X and OpenGL are used for graphics functionality. These are much more powerful and complex than BGI and provide you with functionality to create both 2D and 3D graphics applications. OpenGL, as its name suggests, is an open technology and is also available on open operating systems like Unix and Linux.

Conio.h is also a dos specific file provided by borland and is not available on other compilers and hence the clrscr function. On Windows, you can either call the system function with cls command to clear screen, or search MSDN for a full fledged 32bit version of clrscr().

I hope this would have solved your confusion.
 

QwertyManiac

Commander in Chief
Re: Functions like gotoxy,delay,textcolor in c++ working in turbo C++ but not in dev

^Those are not actually windows specific, but are borland specifc.
Yes, as I said Turbo-provided (Dumbin' it down, ofc the messy work is all Borland's). It is also windows specific cause borland's compilers catered only to it. The same would not work on the UNIX or OS $ platforms.
 

abhishek_del

Journeyman
Re: Functions like gotoxy,delay,textcolor in c++ working in turbo C++ but not in dev

man what r u ppl talking about, its simply that conio.h doesn't exist in Dev C++. If u want conio.h, you can get it from www.sourceforge.net but u have to search for it and you will be able o find these functions.
 
Re: Functions like gotoxy,delay,textcolor in c++ working in turbo C++ but not in dev

What we are talking about is the difference between programming for a 16bit and a 32 bit environment. Many student grow up believing Turbo C++ is what is called C++, they dont exactly understand that C++ is just a CORE language specification and every compiler adheres to it and also adds some compiler specific and/or platform specific functionality to the standard by means of providing extra keywords, headers and libraries. I tried to explain that.

What you are saying is also correct. There are quiet a few implementations of conio.h available on net but using them is not same as copying the file from turbo c++'s directory. They are vastly different from the "original" conio library and are fully 32 bit code. If you look at my post, i had said to search for something like that on MSDN, coz i found one long time back. Sourceforge is another place for that. But its almost the same thing.
Moreover, i dont think there is any library present that mimics the functionality of BGI (graphics.h etc) on 32bit compilers. And even if there is one, that would also be doing it using Direct X or Open GL in the background. So story is more or less same buddy.

The difference is that you touched the surface, and i got in deep :)
 

abhishek_del

Journeyman
Re: Functions like gotoxy,delay,textcolor in c++ working in turbo C++ but not in dev

I know that it is the case of 16 bit and 32 bit systems and Turbo C++ is an old compiler.
32 bit operating systems have different implementations.
 

ambika

learnhardy
Re: Functions like gotoxy,delay,textcolor in c++ working in turbo C++ but not in dev

Why someone not create a sticky thread .......for this issue......"difference between compilers".....
it will be great help!! or there any already??please assign me !! Most of the guys facing these problems(shows in thread)?
 

sankha

Right off the assembly line
Re: Functions like gotoxy,delay,textcolor in c++ working in turbo C++ but not in dev

I think Krazy is right. The C/C++ we use is not the actual C/C++ that were developed. The original C/C++ was not actually meant for graphics and all such small functions we do, the actual C was only meant for system programming and AI language. The whole UNIX o/s is built on C, so you can get the main strength of C. So many functions you get in C are actually provided by third parties. So some functions may not work in some compilers and some may work.






____________________________
Erase data
 

BSOD

Err.. what?
Re: Functions like gotoxy,delay,textcolor in c++ working in turbo C++ but not in dev

In case you really want conio.h with the gotoxy() and the works because you school does not stop *****ing about it, you can get it here.
But, if you are on your own I guess you will be better of learning something like ncurses or any good GUI library. No one uses conio.h to make interfaces.

As a matter of fact, conio.h does exist in Dev C++ except, it does not have all the Turbo C++ extras. Anyway, I guess the root of the problem is the textbooks that schools prescribe. They seem to teach students all the older stuff using ancient compilers that no longer are used. Instead of teaching something interesting and fun or useful. Allegro for the former and STL for the latter are some examples. But, I guess I have no way to change the education system and people who are really interested will learn it own their own. My 0.02 paisa.
 
Last edited:
Re: Functions like gotoxy,delay,textcolor in c++ working in turbo C++ but not in dev

^^The reason behind it is pretty simple actually.

All these boards always use questions from previous years' papers. They hate making completely new questions every year the way IIT-JEE guys do.

Obviously you too know that anyone can score 75% atleast by knowing answers to previous 15 years papers.

And in Computers, perhaps these guys think changing syntax and functions completely is very hard.
 
Status
Not open for further replies.
Top Bottom