Thread: Using system "pause"

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    59

    Using system "pause"

    Hi all,

    Just a quick question,

    Is it possible to use the system ("pause") function with
    the Borland compiler?

    The reason i ask is im at work, so i cant test it.......


    If it doesnt work, is there an equivalant?


    Thanks alot,

    Boontune

  2. #2
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    best way to find out is try

    header file is stdlib.h //i think its early its that or conio.h....

    if it doens't work, dependsing on how your pausing it,

    include conio.h and use getch();

  3. #3
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    getch() Holds the program until a key is pressed (that is, if the
    buffer is empty), and sleep() pauses it for an amount of
    milliseconds so a not that good alternative.

    <windows.h> has sleep() if im not mistaking.

  4. #4
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    It's Sleep(), i.e. with a capital 'S', and is an API routine so should be implemented. Read the FAQ for why you should not use system().
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  5. #5
    Registered User newbie_grg's Avatar
    Join Date
    Jul 2002
    Posts
    77

    yes.

    yes it works with borland compiler. just dont forget to include
    " cstdlib " or if that doesnt work then stdlib.h should do.
    can use getch() (in conio.h) also.
    "If knowledge can create problems, it is not through ignorance that we can solve them. "
    -Isaac Asimov(1920-1992)

  6. #6
    Registered User
    Join Date
    Oct 2002
    Posts
    59
    Thanks alot guys

    Boontune

  7. #7
    Speedy5
    Guest
    In VC++, system() is also in <process.h> (or maybe if that doesn't work: <process>). So since that hasn't been mentioned try it out for Borland. hehe!

  8. #8
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    Why suggest platform dependant routines for such a trivial problem? Use cin.get()

  9. #9
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753
    or you could include <windows.h> as well

  10. #10
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    >>> Why suggest platform dependant routines for such a trivial problem? Use cin.get()

    He stated he was using a Borland compiler, so his platform is fixed. There is nothing wrong in using a platform specific solution if you know your program will not be loaded on another platform. There are, however, problems associated with recommending legacy calls, like system(), they're in the FAQ.

    Duuur, FAQ?

    Frequently Asked Questions...

    http://www.cprogramming.com/boardfaq.html#pause
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File System Implementation
    By dodgeviper in forum C Programming
    Replies: 9
    Last Post: 11-16-2007, 01:04 PM
  2. Using system icons
    By @nthony in forum Windows Programming
    Replies: 1
    Last Post: 01-13-2007, 07:56 PM
  3. Linux database system needed
    By BobS0327 in forum Tech Board
    Replies: 7
    Last Post: 06-11-2006, 03:56 PM
  4. measuring system resources used by a function
    By Aran in forum C Programming
    Replies: 1
    Last Post: 03-13-2006, 05:35 PM
  5. BIOS system and memory allocation problem
    By beely in forum Tech Board
    Replies: 9
    Last Post: 11-25-2003, 07:12 AM