PHP脚本编译C ++文件并运行与输入文件的可执行文件 [英] Php script to compile c++ file and run the executable file with input file

查看:159
本文介绍了PHP脚本编译C ++文件并运行与输入文件的可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个PHP脚本来编译C / C ++文件。
编制并获得该文件的可执行文件后,我需要运行与input.txt的文件的说法,文件,然后比较output.txt的文件中的结果。

I need a php script to compile C/C++ file. After compiling and getting the executable of that file i need to run that file with a argument of input.txt file and then compare the result with output.txt file

我怎样才能做到这一点?

How can i do this ?

推荐答案

调用的命令行C ++编译器使用系统 EXEC ,或反引号的。有没有用PHP编写的C ++编译器。

Call a command-line C++ compiler using system, exec, or backticks. There is no C++ compiler written in PHP.

这篇关于PHP脚本编译C ++文件并运行与输入文件的可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆