Call an application using System() from another program and input a file

Multi tool use


Call an application using System() from another program and input a file
I have a main file and a secondary file. The secondary file is compiled into an executable that I cannot edit. The secondary file asks for a file name using user input.
In order to run the secondary file from the main file, I am using System("secondary.exe"), which then executes the secondary file an prompts the user for input.
Is there a way to bypass that input and hard-code in a file name.
I tried looking at command line piping and popen but was unable to find an answer.
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.