I have a cpp console app that returns some random strings. How to get its output string?
Below what I have tried to call that cpp console app, but I don't have any idea to get its output string?
var processInfo = new ProcessStartInfo();
processInfo.FileName = "/tmp/mycpp.exe ";
processInfo.Arguments = _jpg;
processInfo.CreateNoWindow = true;
processInfo.UseShellExecute = false;
using (var process = new Process())
{
process.StartInfo = processInfo;
process.Start();
process.WaitForExit();
}
and the output string looks like below:
[root@demo car-make-model-classifier-yolo3-cpp]# ./mycpp helloworld
------------------------------------------------
value1: helloworld1
value2: helloworld2
------------------------------------------------
------------------------------------------------
value1: helloworld11
value2: helloworld22
------------------------------------------------