Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • C

Idiom #111 Launch other program

From current process, run program x with command-line parameters "a", "b".

#include <stdlib.h>
int system("x a b");

This spawns a shell and returns, when the child process has exited.
using System.Diagnostics;
string[] args = { "a", "b"};
Process.Start(x, string.Join(" ", args));

New implementation...
< >
programming-idioms.org