Send data between console apps
Posted on 2005-04-16
I've got two instances of the same console application.
The first one creates some data (char * data) of some length. This data should be sent to the second program that'll process the data.
CONSOLE 1 header|length|data CONSOLE 2
char* data; -----------------------> received_data = malloc(length*sizeof(char));
I've tried using _pipe, but this seems not to work.
Note that the CONSOLE 2 will stay in wait mode until it receives a message with the correct header.
I'd like a solution that's a simple as possible, if possible without needing additional non standard libraries. Saving the data to the HDD is not an option.
All this should work under Linux, as well as under Windows (or at least, there should be an alternative for both).
Thanks in advance!