Quote:
Originally Posted by golabi
Thanks Jos for your quick respond
Actually I am quite new in C . Actually I have the C application source code and I should change it to be able to communicate. Is it right to make an exe file after changing C application to be able to open a socket or ordinary input output stream,
and then use this exe file in java application?
Yep, if you can change the C source code you can make it open a socket for communication. The Java application would send commands and receive the results through that socket. If can even make that C application quit by issuing the correct command. Your C application turns into a small server so to speak and your Java application will be its client.
Otherwise, if you hate sockets or are allergic to them ;-) you can issue commands through the C application's input stream (stdin) and it can send the results through its output stream (stdout). The Java application can write to C's input stream and read from its output stream. Again, read the API documentation for the Process class.
kind regards,
Jos