Thread: Function to run A DOS Command???

  1. #1
    Registered User jawwadalam's Avatar
    Join Date
    May 2002
    Posts
    131

    Function to run A DOS Command???

    I wanted to Know the function by using that I can run DOS Commands.... ???
    One day you will ask what more important to you..
    I will say my life..
    and You will leave me with even knowing
    that
    You are my Life (L)

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    (stdlib.h)

    system()

  3. #3
    Registered User jawwadalam's Avatar
    Join Date
    May 2002
    Posts
    131

    Thanx...

    Originally posted by Fordy
    (stdlib.h)

    system()
    Thanx... for the Help... ... . . !
    One day you will ask what more important to you..
    I will say my life..
    and You will leave me with even knowing
    that
    You are my Life (L)

  4. #4
    Anonymous
    Guest
    #include <cstdlib>

    system("command");

    also works...for example, to clear screen:

    #include <iostream>
    #include <string>
    #include <cstdlib>
    using namespace std;

    void main()
    {
    cout << "Hello" << endl; //Output

    system("cls"); //Clears screen

    }

  5. #5
    Seeking motivation... endo's Avatar
    Join Date
    May 2002
    Posts
    537
    Its the same thing as Fordy's answer, just found in a different header.
    Couldn't think of anything interesting, cool or funny - sorry.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. Troubleshooting Input Function
    By SiliconHobo in forum C Programming
    Replies: 14
    Last Post: 12-05-2007, 07:18 AM
  3. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  4. Replies: 28
    Last Post: 07-16-2006, 11:35 PM
  5. Calling a Thread with a Function Pointer.
    By ScrollMaster in forum Windows Programming
    Replies: 6
    Last Post: 06-10-2006, 08:56 AM