system commands

This is a discussion on system commands within the C++ Programming forums, part of the General Programming Boards category; I have a question, i aready found out about Code: system ("PAUSE"); , but are there other commands using 'system' ...

  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,794
    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,452
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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.

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, 05:58 PM
  3. Capturing system commands
    By manwhoonlyeats in forum C Programming
    Replies: 2
    Last Post: 12-07-2002, 06:38 PM
  4. System(); commands
    By Ryan in forum C++ Programming
    Replies: 15
    Last Post: 03-15-2002, 06:05 PM
  5. system commands
    By mervin in forum C Programming
    Replies: 3
    Last Post: 02-03-2002, 08:01 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21