I'm new to linux and programming. I opened an application program from a C program using system("Prog");
Prog-> #after opening the program
This "Prog" accepts certain commands from user and displays output.
Prog-> write # Accepts the command from user
1 2 3 4 5 # Displays the output
Prog-> # Waiting for next command
I want to make the command sent from a C program instead of getting it from the user. I can't use system(""); to send the commands to the opened program "Prog" (as in passing commands to CLI from C program). system(); works only for CLI and not to the opened program.
Is there any way that I can send the commands to opened application from a C program?
I should also store the displayed output "1 2 3 4 5" in a file. Pls help.