output of one c program in another

This is a discussion on output of one c program in another within the C Programming forums, part of the General Programming Boards category; I have written a c program which consists of a decision making statement.The arguments which have to be input are ...

  1. #1
    Registered User
    Join Date
    Jun 2007
    Posts
    24

    output of one c program in another

    I have written a c program which consists of a decision
    making statement.The arguments which have to be input
    are currently a function's return value but i need to
    use another program's output as it's argument .
    It involves running the 2nd program,getting its output and
    then using it in the 1st . This has to be done
    iteratively till there is a satisfactory output from the
    2nd .How can i do this?

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,163
    Check out popen().
    If you understand what you're doing, you're not learning anything.

  3. #3
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    Other solutions: Pipes on the command line.... fork()ing and exec()ing on *nix systems..... CreateProcess() and I think CreatePipe() on Windows.

  4. #4
    Registered User
    Join Date
    Jun 2007
    Posts
    24
    thanks for the reply.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. calling an external program + capture output?
    By cyberfish in forum C++ Programming
    Replies: 4
    Last Post: 03-21-2008, 12:49 AM
  2. program looping with final output
    By hebali in forum C Programming
    Replies: 24
    Last Post: 02-28-2008, 09:58 AM
  3. Unusual program Output, Help
    By capvirgo in forum C Programming
    Replies: 8
    Last Post: 02-06-2008, 02:13 AM
  4. Redirecting program output straight to an edit control
    By bennyandthejets in forum C++ Programming
    Replies: 5
    Last Post: 07-05-2004, 08:25 AM
  5. Program Output
    By lavon in forum C Programming
    Replies: 1
    Last Post: 03-19-2002, 09:32 PM

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