how to a start another application from my c++ program?
how do i start another application from my c++ program ?????
|
Is it on Windows or linux..???
in linux there is a system call "execvp" which can be used to start another program replacing the current one.. if you want to start another process you might want to use fork and then execvp in windows there is WinExec( ) im' not sure about how to use it though :) |
it is a linux system and can take for eg. as
starting a web-browser for my c++ program without quitting it. |
check out the manual for execvp
man execvp :) im' sure youll' be able to get the idea |
1) If you just want to execute a program, wait for it to finish, then continue your program:
Use system() 2) If you want to start a program that runs on its own while your program also continues to run: Use fork() in combination with execvp() 3) If you want to run a program and read from its stdout into your program (or write to its stdin from your program) through a pipe: Use popen() See these man pages for more information: man 3 system man 2 fork man 3 execvp man 3 popen If necessary, google for examples. One site that deals with this among other things, is the freely downloadable book (as PDF's + seperate sample code) "Advanced Linux Programming" (New Riders). Check http://www.advancedlinuxprogramming.com/ |
All times are GMT -5. The time now is 04:08 AM. |