LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   passing arguments to system command (https://www.linuxquestions.org/questions/programming-9/passing-arguments-to-system-command-776301/)

nathan 12-17-2009 12:23 AM

passing arguments to system command
 
Hi,

I am calling another executable in my application (C programing) using "system" command
which is user interactive program.

now i want to pass those args in system command only.

system(" executable ");

Executable will expect 1,2 or 3.

1 is to continue
2 for do changes in settings
3 exit from application

how to pass these in to system command


Thanks in Advance
Nathan

JohnGraham 12-17-2009 03:46 AM

No magic, just do as you would at the command-line - change the string "executable" to "executable 1" and "1" will get passed as the first argument.


All times are GMT -5. The time now is 05:48 AM.