Results 1 to 6 of 6

Thread: Clrscr() & Gotoxy() in C compiler?

  1. #1
    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?

  2. #2
    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!

  3. #3
    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.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    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().

  5. #5
    Join Date
    Jun 2008
    Posts
    81

    Re: Clrscr() & Gotoxy() in C compiler?

    For more discussion
    clrscr(); in C

  6. #6
    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...

Similar Threads

  1. Which is the best C++ Compiler
    By Ambak in forum Polls & Voting
    Replies: 7
    Last Post: 20-01-2012, 11:39 AM
  2. JIT compiler for .NET platform
    By VAIJAYI in forum Software Development
    Replies: 6
    Last Post: 17-01-2011, 11:11 PM
  3. Best C Compiler
    By kyosang in forum Software Development
    Replies: 3
    Last Post: 30-12-2009, 09:18 AM
  4. Compiler for PHP
    By Farley in forum Software Development
    Replies: 3
    Last Post: 13-03-2009, 07:31 PM
  5. clrscr(); in C
    By nehal_serpa in forum Software Development
    Replies: 3
    Last Post: 08-08-2008, 07:50 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,306,592.55318 seconds with 17 queries