By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,501 Members | 2,861 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,501 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.
Oct 28 '10 #1
Share this Question
Share on Google+
6 Replies

P: 175
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.
Oct 28 '10 #2

P: 7
You can do this with piping on commandline, like
Expand|Select|Wrap|Line Numbers
  1. add.exe 1 2 | sqr.exe
where add.exe put to stdout and sqr.exe reads from stdin and put to stdout
Oct 28 '10 #3

Expert 100+
P: 2,400
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?
Oct 29 '10 #4

Jose Diaz
P: 5
You have to Write a DLL (DYNAMIC LINK LIBRARY) using the WINDOWS API: WINAPI. That how i do it.
Nov 17 '10 #5

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

Nov 18 '10 #6

P: 1,059
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....
Nov 19 '10 #7

Post your reply

Sign in to post your reply or Sign up for a free account.