title: Passing a pipe as a parameter in exec
body: <p>I'm trying to pass a pipe to another process, which I create with execv.  This is my code so far, but it doesn't work.  I've looked everywhere for information, but I can't find anything specifically about passing a pipe vie exec.  Any help is appreciated.  Thanks</p>
  
  <pre><code>int fd[2];
  pipe(fd);
  
  char passwrite[1];
  sprintf(passwrite, "%d", fd[0]);
  
  char arg[1];
  arg[1]=passwrite;
  
  int x;
  x=fork();
  if (x==0) {
  execv("NewProg",arg);
  }
  </code></pre>