title: how to search for a string in a string array in c++
body: <p>say i have the following:</p>
  
  <pre><code>string myArray[] = { "adam", "aaron", "brad", "brandon" };
  
  cout &lt;&lt; "Please type a name: ";
  </code></pre>
  
  <p>i want it so when a user types "bra" and hits enter, the program returns </p>
  
  <pre><code>brad
  brandon
  </code></pre>
  
  <p>if the user types "a", the program returns</p>
  
  <pre><code>adam
  aaron
  </code></pre>
  
  <p>if the user types "adam", the program returns</p>
  
  <pre><code>adam
  </code></pre>
  
  <p>I have tried strstr, mystring.compare(str), mystring.compare(x, n, str) - i can't find anything that is working. </p>
  
  <p>what function would be the best way of handling this operation?</p>