title: find substring in a string with loops in c++
body: <p>The code will get two string from user and checks the string , includes substring as the second input or not.</p>
  
  <pre><code>    string st1;
      string subst1;
      string message = " ";
      cout &lt;&lt; "Enter string and subst:";
      cin &gt;&gt; st1;
      cin &gt;&gt; subst1;
  
      for (int a=0; a &lt; st1.length(); a++) {
          if (st1[a] == subst1[0]) {
              for (int k = 0; k &lt; subst1.length(); k++) {
                  if (st1[a + k] == subst1[k])
                      message = "True";
                  else
                      message = "False";
              }
          }
      }
      cout &lt;&lt; message;
  </code></pre>
  
  <p>This code does not work inputs like "alice" and "ba". The output should be false but when I execute the code program directly ended </p>