title: C - get all substrings between two delimiters
body: <p>I am trying to create an application that responds to multiple commands inputted by the users. The problem is that these commands have multiple parameters. Some examples would be</p>
  <pre><code>login 'username' 'password'
  add song 'song_name' 'description' 'genre' 'link'
  </code></pre>
  <p>The input is read into a char array.</p>
  <pre><code>char recv[max]=&quot; &quot;;
  if (read (fd, recv, sizeof (recv)) &lt; 0)
      {
          perror (&quot;[server]Error on read () from client.\n&quot;);
          return errno;
      }
  </code></pre>
  <p>This is all part of a bigger uni project using servers, so that is the reason for using read(). max is defined as 1024.</p>
  <p>While I can use strstr() to identify which command is which, I'm not sure how I could get the username, password and so on as separate substrings.</p>
  <p>I know that I can get rid of the command part by copying into another char the input+the command length, as it is fixed, but I'm keen on finding out how I can select each substring between two ''s. Would strtok() do the job?</p>
  <p>Thanks in advance.</p>