This is a discussion on How can I invoke another program from C? within the C and C++ Programming forums, part of the Software Development category; How can I invoke another program (a standalone executable, or an operating system command) from within a C program?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| How can I invoke another program (a standalone executable, or an operating system command) from within a C program?
__________________ Thanks & Regards Sabari... |
| Sponsored Links |
| |||
| Hi, Use the library function system, which does exactly that. Some systems also provide a family of spawn routines which accomplish approximately the same thing. system is more ``portable'' in that it is required under the ANSI C Standard, although the interpretation of the command string--its syntax and the set of commands accepted--will obviously vary tremendously. The system function ``calls'' a command in the manner of a subroutine, and control eventually returns to the calling program. If you want to overlay the calling program with another program (that is, a ``chain'' operation) you'll need a system-specific routine, such as the exec family on Unix. Note that system's return value is at best the command's exit status (although even that is not guaranteed), and usually has nothing to do with the output of the command. Thanks, Prasath.K |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to invoke a method on a remote object? | mobilegeek | Java Programming | 2 | 09-10-2007 04:54 AM |
| How to launch Real Player program through my j2me midlet program? | itbarota | J2ME | 1 | 07-25-2007 11:39 PM |
| when the program is executing,how to stop the program and open the cmd window... | bluesky | C# Programming | 1 | 07-25-2007 05:51 AM |
| How can I invoke another program or command and trap its output in C? | Sabari | C and C++ Programming | 1 | 07-17-2007 04:01 AM |
| chat program | pranky | C and C++ Programming | 0 | 02-24-2007 01:02 AM |