This is a discussion on Confused on Return Status within the C and C++ forums, part of the Programming Talk category; I am using UNIX operating system and now I am trying out quite a number of programs in C programming ...
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I am using UNIX operating system and now I am trying out quite a number of programs in C programming language in my UNIX environment. I recently came across a function named as system() and thought of trying out this by a sample program to get idea about this function. I wrote the below C code for that
main() { int a = system("excel.exe"); } I know that the above would open excel and exist from this only when the users exit from this. But the point I am confused is what is the return status from this system() function. Will it be the exit code of the excel process? Kindly clarify me on this. |
|
|||
|
Many might think that the function system() would return the exit code of the process initiated namely excel.exe. But it is wrong. The system() function instead returns the exit code of the shell that initiates the process. In your example the system() function would return the exit code of the shell that initiated excel and would not return Excel’s exit status.
|
![]() |
| Thread Tools | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| RPN/RPL Calculator implementations, list of, regular post [long, FAQ] | Craig A. Finseth | Tech FAQ | 0 | 06-14-2004 10:34 AM |
| comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) | Steve Summit | Tech FAQ | 0 | 06-01-2004 07:01 AM |
| comp.lang.c Answers to Frequently Asked Questions (FAQ List) | Steve Summit | Tech FAQ | 0 | 06-01-2004 07:00 AM |
| comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) | Steve Summit | Tech FAQ | 0 | 05-15-2004 07:00 AM |
| RPN/RPL Calculator implementations, list of, regular post [long, FAQ] | Craig A. Finseth | Tech FAQ | 0 | 04-12-2004 10:27 AM |