I want to compile a .c file using PHP’s system function and display the th开发者_如何学Ce error (if any) to another text field, else display nothing. How can I do that?
You could launch a compilation command with system function:
$output = system("gcc -Wall -c yourtmpfile.c");
outtmpfile.c is a temporary file you need to create.
In $output you will have the output of the compilation command.
http://www.php.net/manual/en/function.system.php
"If the return_var argument is present, then the return status of the executed command will be written to this variable."
Then write the content of the variable to your textfield...
Take a look at PHP's system() function.
echo system('gcc file.c');
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论