I’m trying to run a .exe from c++ using system. The argument, a text file, is asked for after calling the .exe. I need a way to provide this argument.
To clarify in bash I can do this:
cd /programlocation
wine program.exe
This then outputs,
Enter input file name :
If i now type
inputfile.txt
It works, but I cannot figure a way to combine this last step so I can run it using system from c++.
ie. This doesn’t work:
std::string location = "cd /location/"
std::string program = "wine program.exe"
std::string input = "inputfile.txt";
std::string command = location+"&&"+program+"&&"+input;
const char *cmd = command.c_str();
system(cmd);
This just asks for input file in the console.
If you can access it the program I’m trying to run is the a8711v30 esdu aircraft engine noise prediction file.
if program.exe is reading from stdin and not from the terminal, then you might be able to call system with the string: