出力を計算してその出力を返す c++ .exe に値を渡す PHP ファイルを作成しています。ただし、.exe からの出力を 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;
}