how to pass values from one c program to another c program ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zax mathew

    how to pass values from one c program to another c program ?

    we need to pass the values and operate on that in the second program and return the result to the first program and display the result from the first program.
  • manontheedge
    New Member
    • Oct 2006
    • 175

    #2
    you could have the program producing the result write to some file, and have the one that will display the result constantly checking the file.

    Other than that I'm not sure, though, Shell Execute comes to mind. I don't know, that may be helpful.

    Comment

    • BillyTKid
      New Member
      • Aug 2010
      • 7

      #3
      You can do this with piping on commandline, like
      Code:
      add.exe 1 2 | sqr.exe
      where add.exe put to stdout and sqr.exe reads from stdin and put to stdout

      Comment

      • donbock
        Recognized Expert Top Contributor
        • Mar 2008
        • 2427

        #4
        Are these two programs threads/processes/tasks that are running simultaneously on the same computer?

        Do these two programs run at different times on the same computer?

        Do these two programs run simultaneously on two computers that are connected by a data link?

        Do these two programs run at different times on two computers that are not necessarily connected by a data link?

        Comment

        • Jose Diaz
          New Member
          • Nov 2010
          • 6

          #5
          You have to Write a DLL (DYNAMIC LINK LIBRARY) using the WINDOWS API: WINAPI. That how i do it.

          Comment

          • Bryan Cheung
            New Member
            • Nov 2010
            • 55

            #6
            Don't know much(nothing) about C, but can't you use XML? Because well, thats mostly the purpose of XML..

            -Bryan

            Comment

            • johny10151981
              Top Contributor
              • Jan 2010
              • 1059

              #7
              Why the second Program would have to be a stand alone program?

              The functionality that you need can be built as DLL as Jose Diaz (if you explained properly.) said.

              OR you can Try RPC for win32 or for linux you can TRY Inter process communication(IPC). Or you can simply develop a client/server Application Using BSD Socket. Can be defined same way in both linux and windows system....

              Comment

              Working...