title: c++ identifying special characters in a string
body: <p>I am writing a program for school that is supposed to check the strength of passwords and separate them into 3 parameters. I am having an issue identifying special characters in a strong to classify a strong character. any help is greatly appreciated.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  int main()
  {
      string input;
      bool complete = false;
      bool hasUpper = false;
      bool hasLower = false;
      bool hasDigit = false;
      bool specialChar = false;
      int count;
      char special = 'a';
  
  
      do
      {
          cout &lt;&lt; endl &lt;&lt; "Enter a password to rate its strength. Enter q to quit." &lt;&lt; endl;
          cin &gt;&gt; input;
  
          for(count =0; count &lt; input.size(); count++)
          {
              if( islower(input[count]) )
              hasLower = true;
  
              if( isupper(input[count]) )
              hasUpper = true;
  
              if( isdigit(input[count]) )
              hasDigit = true;
  
              special = input.find_first_not_of("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 ");
  
              if (special != 'a')
              specialChar = true;
          }
  
          if (hasLower &amp;&amp; hasUpper &amp;&amp; hasDigit &amp;&amp; specialChar &amp;&amp; (count &gt;= 8))
          {
              cout &lt;&lt; "Strong" &lt;&lt; endl;
          }
          else if((hasLower || hasUpper) &amp;&amp; hasDigit &amp;&amp; (count &gt;= 6))
          {
              cout &lt;&lt; "Moderate" &lt;&lt; endl;
          }
          else
          { 
              cout &lt;&lt; "Weak" &lt;&lt; endl;
          }
          if (input == "q") complete = true; 
      }while (!complete);
      return 0;
  }
  </code></pre>