Thread: system commands

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    24

    Question system commands

    I have a question, i aready found out about
    Code:
    system ("PAUSE");
    , but are there other commands using 'system' and if yes, please explain their use.

  2. #2
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,817
    This is completely dependent on the OS you have.
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

  3. #3
    Registered User
    Join Date
    Jul 2004
    Posts
    24
    This is completely dependent on the OS you have.
    OS? What`s that?

  4. #4
    VA National Guard The Brain's Avatar
    Join Date
    May 2004
    Location
    Manassas, VA USA
    Posts
    903

    Exclamation #include<cstdlib>

    You can use ' system( )' to make any call to your operating system.

    system("pause") and system("cls") seem to be the most popular uses... although, keep in mind that such casual use of the system( ) function is highly discouraged.

    check the FAQ for better alternatives... under "How do I clear the screen.. " and "How do I make my program wait for a keypress"

    also, remember that system( ) is operating system independant.

    A forum search will reveal a multitude of threads on this subject.
    Last edited by The Brain; 08-25-2004 at 06:37 PM.
    • "Problem Solving C++, The Object of Programming" -Walter Savitch
    • "Data Structures and Other Objects using C++" -Walter Savitch
    • "Assembly Language for Intel-Based Computers" -Kip Irvine
    • "Programming Windows, 5th edition" -Charles Petzold
    • "Visual C++ MFC Programming by Example" -John E. Swanke
    • "Network Programming Windows" -Jones/Ohlund
    • "Sams Teach Yourself Game Programming in 24 Hours" -Michael Morrison
    • "Mathmatics for 3D Game Programming & Computer Graphics" -Eric Lengyel

  5. #5
    Registered User
    Join Date
    Jul 2004
    Posts
    24
    Hey brain, thats chinese sign for dragon right?

  6. #6
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    Quote Originally Posted by darealnash
    OS? What`s that?
    Operating System....

    system() is used to envoke another executable from within your program or issue a system command to your OS... listen to the Brain above, he comes bearing valuable content

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Basically, whatever you feel like typing on the command line
    c:\> dir
    c:\> type file.txt

    Of course, if your command line is Unix, you have a much more powerful command line to play with.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  8. #8
    VA National Guard The Brain's Avatar
    Join Date
    May 2004
    Location
    Manassas, VA USA
    Posts
    903

    :)

    Yep.. chinese symbol for dragon.. i'm thinkin' it would be a cool tatoo or something
    • "Problem Solving C++, The Object of Programming" -Walter Savitch
    • "Data Structures and Other Objects using C++" -Walter Savitch
    • "Assembly Language for Intel-Based Computers" -Kip Irvine
    • "Programming Windows, 5th edition" -Charles Petzold
    • "Visual C++ MFC Programming by Example" -John E. Swanke
    • "Network Programming Windows" -Jones/Ohlund
    • "Sams Teach Yourself Game Programming in 24 Hours" -Michael Morrison
    • "Mathmatics for 3D Game Programming & Computer Graphics" -Eric Lengyel

  9. #9
    Registered User caroundw5h's Avatar
    Join Date
    Oct 2003
    Posts
    751
    Quote Originally Posted by darealnash
    I have a question, i aready found out about
    Code:
    system ("PAUSE");
    , but are there other commands using 'system' and if yes, please explain their use.
    if your on windows go to run, type cmd and then "help".
    this will list many of the commands available to you. If your on linux consult your man pages.
    Warning: Opinions subject to change without notice

    The C Library Reference Guide
    Understand the fundamentals
    Then have some more fun

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. running system commands??
    By killdragon in forum C++ Programming
    Replies: 13
    Last Post: 09-25-2004, 02:49 PM
  2. what can i type into msdn to bring up all the system commands
    By Shadow12345 in forum Windows Programming
    Replies: 10
    Last Post: 12-30-2002, 06:58 PM
  3. Capturing system commands
    By manwhoonlyeats in forum C Programming
    Replies: 2
    Last Post: 12-07-2002, 07:38 PM
  4. System(); commands
    By Ryan in forum C++ Programming
    Replies: 15
    Last Post: 03-15-2002, 07:05 PM
  5. system commands
    By mervin in forum C Programming
    Replies: 3
    Last Post: 02-03-2002, 09:01 AM