用php脚本执行c ++程序 [英] execute c++ program with php script

查看:127
本文介绍了用php脚本执行c ++程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在php脚本中运行一个c ++代码。它需要6个运行时参数。

我尝试使用:

  exec ,{125,70,127,220,0.5,0.4}) 

但它不工作。

解决方案

您可以使用调用:

  exec(./ controller.exe 125 70 127 220 0.5 0.4,$ out); 

如果感兴趣,$ out将保存输出


I want to run a c++ code in php script. It takes 6 runtime arguments.
I am trying with:

exec("./controller.exe",{"125", "70", "127", "220" ,"0.5", "0.4"});

But it is not working.

解决方案

You can use the call:

exec("./controller.exe 125 70 127 220 0.5 0.4", $out);

$out will hold the output if you are interested

这篇关于用php脚本执行c ++程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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