title: cpp string find() doesnt work as expected - returns big junk values
body: <p>I'm trying to find the index of a substring in another string, using find(), but getting a junk value and not std::npos if the substring is not there.</p>
  <p>This is the Code:</p>
  <blockquote>
  <p>string output1 = &quot;abcd&quot;;</p>
  <p>cout &lt;&lt; output.find(&quot;gf&quot;) &lt;&lt; endl;</p>
  </blockquote>
  <p>And this is the output:</p>
  <blockquote>
  <p>18446744073709551615</p>
  </blockquote>
  <p>can this behaviour be prevented? is there another way to find the substring?</p>
  <p>(actually i only need to find <strong>if</strong> the substring is contained)</p>
  <p>Thank you</p>