On Thu, 22 Jan 2004, Michael Ryan Byrd wrote:

> So, in C, is there a way to capture the stdout from a function?

I've occasionally been able to point stdout somewhere else.  Perhaps something 
like this would work:

FILE *oldstdout = stdout;
fflush(stdout);
fopen(stdout, "foo_output", "w");
foo();
fclose(stdout);
stdout = oldstdout;

                                        -J


____________________
BYU Unix Users Group 
http://uug.byu.edu/ 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to