title: C++ search for words string
body: <p>I want to create program which will go through sentence and if it finds a character or a word it will display it. </p>
  
  <p>Think of a program that stops as soon as it find first character/word.</p>
  
  <pre><code>   string test("This is sentense i would like to find ! "); //his is sentense to be searched
     string look; // word/char that i want to search
  
     cin &gt;&gt; look;
  
     for (i = 0; i &lt; test.size(); i++) //i&lt;string size
      {
         unsigned searcher = test.find((look));
         if (searcher != string::npos) {
             cout &lt;&lt; "found at : " &lt;&lt; searcher;
         }
     }
  </code></pre>