Posted by Vince Morgan on 12/23/07 14:44
"Daniel Klein" <danielk@featherbrain.net> wrote in message
news:u89qm352ob3hep0heags7bd82q3seqcdjb@4ax.com...
> I'm trying to get popen to work on Windows.
>
> Here's a simplified example of what I'm trying to get working:
>
> I have a hw.c program as follows:
>
> #include <stdio.h>
> main()
> {
> printf ("Hello World!\n");
> }
>
> And here's the 'popentest.php' code:
>
I could be wrong, but "printf()" is going to want to output to a consul, and
I can't see how you are going to capture the output via "popen()" which is
expecting a file pointer. You need to capture the output as a string so
that it can be output to the server as HTML or whatever. However you cannot
return a string from a C executable.
HTH
Vince
[Back to original message]
|