title: pass string to bool function
body: <p>How can I get tis to work by passing a string to a Boolean function? I need to have the user input a series of strings, and after each entry, the program should give feedback depending upon whether or not the string fit the given criteria. The string should contain the substring of "1101", without any letters. Thanks for all your help</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstring&gt; // for strstr
  #include &lt;string&gt;
  #include &lt;cctype&gt;
  
  using namespace std;
  
  bool stringCompare(char*y);
  string str2;
  int main ()
  {
      string str1, str2;
      str1= "1101";
  
      do
      {
      cout &lt;&lt; "Please enter your string: " &lt;&lt; endl;
      cin &gt;&gt; str2;
  
      while((stringCompare(str2)) == true)
      {
  
      if(strstr(str2.c_str(),str1.c_str())) // Primary string search function
      {
      cout &lt;&lt; "ACCEPTED  " &lt;&lt; endl;
      }
      else
      cout &lt;&lt; "NOT ACCEPTED  " &lt;&lt; endl;
  }
      } while (2 &gt; 1);
  
      return 0;
  }
  
  bool stringCompare(char*y)
  {
      for(int a = 0; a &lt; strlen(str2); a++)
      {
      if (!isdigit(str2[a]))
      return false;
      }
      return true;
  }
  </code></pre>