+2  A: 

The simplest way if you don't have popen() etc, or you want to avoid the complexity, is to simplly write a data file eg. infile with fwrite() execute the external program with system() and then read outfile.

system("prog.exe <infile >outfile")

Your prog.exe only has to read stdin and write stdout.

This way you can easily test it with the contents of in/out file. You would normally do this in your tmp directory and then delete them when you are finished.

The only thing to be careful of is the path to the .exe

Martin Beckett
Thank you very much.
Enjoy coding
+1  A: 

Google for "windows popen" and you find this link:

lists.trolltech.com/qt-interest/1999-09/thread00282-0.html

The C runtime library also has _popen(), but I would recommend against it.