Hei guys, I have a problem in executing an C++ exe file from php.
PHP hs such function exec().
exec($command . " " . $parameters, $output);
Example:
exec("ping" . " " ."-a -t",$output);
Where
$command - path to exe file
$parameters - input parameters to the C++ program
$output - everything that is returned by C++ program to the console
So php simply writes such line to cmd:
ping -a -t
So I have such an exe (project.exe), who's main function looks like this:
int _tmain(int argc, _TCHAR* argv[])
{
char out[13];
char in[15];
gets (in);
whitebox(in,out);
printf(out);
return 0;
}
SO my problem is how do I edit this function so that I would be able to write such a line to cmd and the program would work with my parameters:
E:>project.exe "parameters"