Possible Duplicate:
Capturing stdout from a system() command optimally
I'm trying to call the function system() and read in what ever output it would produce on the command processor.
//system acts as a command processor
char string[250];
system("ls");
//put result into string
return 0;
What would be a good way to go about it?