Search code examples
c++returnsystemexecutable

Accessing the values returned by an executable C++


I am running an executable file (written in C#) from a C++ program using the system command and passing a string to it. The executable file returns some string. Is it possible to access the string returned by the executable file from the C++ program? Is there an easy way to do it using the systems command? I am using visual studio.


Solution

  • If you mean the string is written to the command line of the c# program and you want to capture it then you could use named pipes to intercept the output generated from the c# program.

    see https://msdn.microsoft.com/en-us/library/ms682499.aspx

    from your c++ program

    Or, please clarify what you mean by "running an executable file" and "using the system command" - are you writing code or running at a command prompt ?