Hi,
I don't know why we can't use Clrscr() & Gotoxy() in some of the C compilers?
Anyone knows the answer?
Hi,
I don't know why we can't use Clrscr() & Gotoxy() in some of the C compilers?
Anyone knows the answer?
Hello!
I know that this is true but dont know the valid reason behind this!
There are many such functions which you may or may not find in different compilers! Like Conio.h is used in all compilers but some compilers like Dev-C++ provide this function but with limited functionality!
gotoxy is a borland-specific function which was never implemented by any other compiler. If you want to use it with other compilers you will have to write your own gotoxy() function using operating system specific api calls.
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().
For more discussion
clrscr(); in C
There are few functions which are available in some compliers but not the others.
say the example :- The functions 'void, clrscr() etc are not in ANSI C++, while it is supported by turbo c++.
Now say
_setcursortype(_NORMALCURSOR);
this function is not available in in early releases Turbo C(like 2.0), but was in some later releases, I think..
Now here ...................
Now this clrscr() is declared under #include <conio.h>.
Now if u are using GCC, then it does not contain a C library, it just uses the library (headers included) that come with the OS.
i.e. these most functions are compiler as well as OS dependent and it changes even in versions of the same compiler.
Hope it cleared ur doubts...
Bookmarks