我正在創建一個PHP文件以將值傳遞給C++ .exe,然後它將計算輸出並返回該輸出。但是,我似乎無法將.exe的輸出返回到PHP文件中。將輸出從C++傳遞到PHP
PHP代碼:
$path = 'C:enter code here\Users\sumit.exe';
$handle = popen($path,'w');
$write = fwrite($handle,"37");
pclose($handle);
C++代碼:
#include "stdafx.h"
#include <iostream>
using namespace std;
// Declaation of Input Variables:
int main()
{
int num;
cin>> num;
std::cout<<num+5;
return 0;
}
謝謝,這個工作很完美。 – Wayne 2013-03-11 17:08:10