C: Launching a program from a program
|
Author |
Message |
|
|
Posted : Tue, 09 December 2008 03:30:32
Subject :
C: Launching a program from a program
I know some C and some Ncurses, and I wanted to learn how to make a little menu program which displays the names of three or four external programs, and then executes the program selected by the user. When the selected program terminates, the user is returned to the menu program. (Similiar to those old DOS menus which some people used before Windows came along.)
Could anyone start me off in the right direction? Specifically, I was wondering about how I should approach calling the external program that the user requests. I found a few pages online about executing programs from inside C, but they tended to be somewhat complex with lots of discussion about inter-process communication and piping and such. Is there a C library for that makes this fairly simple? (Even if it is a *nix only library...)
It might also be helpful if someone could point me to a program that does something similar to what I described.
|
|
|
|
tophandcwby
|
Posted : Tue, 09 December 2008 14:52:48
Subject :
C: Launching a program from a program
http://www.gnu.org/software/libc/manual/html_node/Processes.html#Processes
That should help a little anyhow.
|
|
proopnarine
|
Posted : Wed, 10 December 2008 04:55:10
Subject :
C: Launching a program from a program
Hey PerlCoder, I'm not an Ncurses user, though I'd love to learn more about it for exactly the reasons you outline. But in the past, for issuing commands or calling programs from within C++ programs, I've used the "popen" function.
|
|
PerlCoder
|
Posted : Wed, 10 December 2008 19:32:19
Subject :
C: Launching a program from a program
Thanks guys! This is just what I was looking for.
|