Running another program

This is a discussion on Running another program within the C++ Programming forums, part of the General Programming Boards category; How do you make a program activate a different console application and input values into it? I'm guessing this is ...

  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    22

    Running another program

    How do you make a program activate a different console application and input values into it?

    I'm guessing this is far easier said than done.

    Thanks for reading.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Depends quite a bit on what you are actually trying to do.

    Starting a console program is pretty easy:
    Code:
    system("myprog");
    If you want to pass arguments to it:
    Code:
    system("myprog arg1 arg2");
    However, if you want to interact more than that with the application, it gets more difficult. You need to explain further about what you want to do, if that's the case.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    May 2008
    Posts
    22

    Thanks

    Thanks Mat. I still don't know how to input values but its a good start.
    Last edited by koxson; 02-06-2009 at 12:25 PM.

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by koxson View Post
    Thanks Mat. I still don't know how to input values but its a good start.
    That would depend on how the program you are starting in itself takes input values. If you describe that, then we can give more suitable advice.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program running long
    By smarta_982002 in forum Windows Programming
    Replies: 3
    Last Post: 03-27-2008, 05:24 AM
  2. Running my program in the background
    By shoobsie in forum Windows Programming
    Replies: 4
    Last Post: 10-09-2005, 02:38 AM
  3. Replies: 3
    Last Post: 09-05-2005, 08:57 AM
  4. Why is my program running away?
    By badkitty in forum C++ Programming
    Replies: 4
    Last Post: 09-19-2001, 04:27 PM
  5. Running program
    By muffin in forum C Programming
    Replies: 5
    Last Post: 08-30-2001, 10:57 AM

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