Thread: Compile the program?

  1. #1
    Registered User marrk's Avatar
    Join Date
    Sep 2006
    Posts
    23

    Compile the program?

    If I use functions like gotoxy(), clrscr(), _setcursortype(),...... in my programs and then compile it, the programs don't run on other computers only on mine. I'm using borland c++ builder 6.

    Thanks

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    When you use compiler-specific extensions, you shouldn't expect your code to compile on another implementation.
    My best code is written with the delete key.

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    You can implement those non-standard functions with Win32 ones and get it to compile under Dev-C++ or something however. The FAQ has a Win32 implementation of clrscr() I believe, and you should be able to find others if you search the board.

    The only compiler I know of that has _setcursortype() is DJGPP. DJGPP has a ScreenSetCursor() function which is the same as gotoxy() (although I think it's one-based; the upper left corner is (1,1), not (0,0)) and clrscr(), too. You could try compiling with it: http://delorie.com/djgpp. But I don't know what that would gain you: it's a DOS compiler, just like borland c++. It would run on the same platforms.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program Plan
    By Programmer_P in forum C++ Programming
    Replies: 0
    Last Post: 05-11-2009, 01:42 AM
  2. Compile Public Domain Pocket PC C Program
    By m1l in forum Projects and Job Recruitment
    Replies: 2
    Last Post: 07-20-2007, 04:02 AM
  3. Using variables in system()
    By Afro in forum C Programming
    Replies: 8
    Last Post: 07-03-2007, 12:27 PM
  4. new to C--can't get program to compile
    By samerune in forum C Programming
    Replies: 12
    Last Post: 04-02-2007, 09:44 AM
  5. how do i compile a program that deals w/classes?
    By Shy_girl_311 in forum C++ Programming
    Replies: 5
    Last Post: 11-11-2001, 02:32 AM