title: How to call execl() in C with the proper arguments?
body: <p>i have vlc (program to reproduce videos)
  if i type in a shell:</p>
  
  <p>/home/vlc "/home/my movies/the movie i want to see.mkv"</p>
  
  <p>it opens up an reproduces the movie.</p>
  
  <p>however, when I run the following program:</p>
  
  <pre><code>#include &lt;unistd.h&gt;
  
  int main(void) {
  
    execl("/home/vlc", "/home/my movies/the movie i want to see.mkv",NULL);
  
    return 0;
  }
  </code></pre>
  
  <p>vlc opens up but doesn't reproduce anything. How can I solve this?</p>
  
  <p>Things I tried:</p>
  
  <p>I guessed</p>
  
  <pre><code>execl("/home/vlc", "/home/my movies/the movie i want to see.mkv",NULL);
  </code></pre>
  
  <p>was equivalent to typing in the shell:</p>
  
  <pre><code>/home/vlc /home/my movies/the movie i want to see.mkv
  </code></pre>
  
  <p>which doesn't work, so i tried</p>
  
  <pre><code> execl("/home/vlc", "\"/home/my movies/the movie i want to see.mkv\"",NULL);
  </code></pre>
  
  <p>and vlc opens up but doesn't reproduce either.</p>
  
  <p>Instead of writing NULL at the end I tried 0, (char*) 0, 1 .... not helpful.
  Help!!!!</p>