I want to write a program in csharp that can compile cpp codes using GCC compiler and running the exe file, sending inputs and get outputs. my solution is using "Process" class and run cmd and ... . but is there any better way?
As we have understood you want to use precompiled executable in CLR. In this case you’re going to mix up unmanaged code with managed one. The right way to do it is to use DLLImport. So you’ll have to compile your c++ code into dll. See more here.