Possible Duplicate:
How to execute a command and get output of command within C++?
In my c++ program, I'm running an external program using execv/system.
I would like to redirect the output of the program to a buffer in my program,i.e.:
char* buff[some size large enough for any possible output];
system(some program);
//THE PROGRAM I JUST RAN IS A SPECIAL BLACK BOX PROGRAM THAT RUNS
//AND PARSE AN HTTP DUMP FILE AND PRINTS IT TO THE SCREEN WHEN RUNNING
//I WANT THE OUTPUT TO GO A BUFFER IN MY PROGRAM.
//THE IDEA IS TO HAVE THE DATA OF THE OUTPUT ON THE BUFFER RATHER THAN ON A FILE
//have the buffer filled with the output of the program
Thanks :-)