What is the proper way to use string::find to look for a word?
<p>How would I look through a string for a word rather then each character in that word. I have my code here and it always seems to find everything that is .obj even if its o or b or j or "." I checked the docuementation <a href="http://www.cplusplus.com/reference/string/string/find/" rel="nofollow">here</a> but was unable to find an answer. Here is my code:</p>

<pre><code> string &amp;str = *it;

 if(it-&gt;find(".obj"))
 {
     cout &lt;&lt; "Found .Obj" &lt;&lt; endl;
 }
</code></pre>

<p>I also tried to use <code>string::compare</code> but that failed.</p>
