title: Find occurrences of all substrings in a given string
body: <p>I use a simple string function <code>strstr</code> to find the first occurrence of a string in some text. I used the following code to count the number of unique words in a text.</p>
  <pre><code>for (int i = 0; i &lt; 24; i++) 
  {
      if (strstr(text, ops[i])) 
      {
          op++;
      }
  }
  </code></pre>
  <p>But I want to find the occurrence of all the sub strings in the program. How can I do this?</p>