Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 12-02-2009
Member
 
Join Date: Jan 2009
Posts: 18
Clrscr() & Gotoxy() in C compiler?

Hi,
I don't know why we can't use Clrscr() & Gotoxy() in some of the C compilers?

Anyone knows the answer?
Reply With Quote
  #2  
Old 12-02-2009
Member
 
Join Date: Jan 2009
Posts: 38
Re: Clrscr() & Gotoxy() in C compiler?

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!
Reply With Quote
  #3  
Old 12-02-2009
Member
 
Join Date: Dec 2007
Posts: 38
Re: Clrscr() & Gotoxy() in C compiler?

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.
Reply With Quote
  #4  
Old 12-02-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: Clrscr() & Gotoxy() in C compiler?

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().
Reply With Quote
  #5  
Old 12-02-2009
Member
 
Join Date: Jun 2008
Posts: 81
Re: Clrscr() & Gotoxy() in C compiler?

For more discussion
clrscr(); in C
Reply With Quote
  #6  
Old 12-02-2009
Member
 
Join Date: May 2008
Posts: 27
Re: Clrscr() & Gotoxy() in C compiler?

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...
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Clrscr() & Gotoxy() in C compiler?"
Thread Thread Starter Forum Replies Last Post
Which is the best C++ Compiler Ambak Polls & Voting 7 20-01-2012 11:39 AM
JIT compiler for .NET platform VAIJAYI Software Development 6 17-01-2011 11:11 PM
Best C Compiler kyosang Software Development 3 30-12-2009 09:18 AM
Compiler for PHP Farley Software Development 3 13-03-2009 07:31 PM
clrscr(); in C nehal_serpa Software Development 3 08-08-2008 07:50 PM


All times are GMT +5.5. The time now is 07:56 AM.