I need to work with two C programs that exchange data through a file-based interface. That is, each of them has a main loop in which it polls three or four files (fopen, fscanf), responds to what it reads, and ultimately makes its own changes to the files (fprintf) to read another process.
Now I need to condense these two programs into one program with minimal changes in the program logic and in the general code. However, mainly for aesthetic reasons, I have to replace the file connection with something in my memory.
I can imagine some hacker ways to do this, but I'm sure stackoverflow will give me a hint for a nice solution :)
source
share