title: Determine if all characters in a string are unique in C++
body: <p>Trying to implement a fairly simple program in C++. I'm kinda new to this language. But it doesn't seem to be working.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  
  using namespace std;
  
  bool isUnique(string);
  
  int main(){
      bool uniq;
      string a;
      cout &lt;&lt; "Please input a string, not a very long one...."&lt;&lt; endl;
      getline(cin, a);
      uniq = isUnique(a);
      if (uniq == true)
          {
              cout &lt;&lt; "The string has no repeatations." &lt;&lt;endl;
          }else{
              cout &lt;&lt; "The characters in the string are not unique." &lt;&lt;endl;
          }
      return EXIT_SUCCESS;
  
  
  }
  
  bool isUnique(string str){
  
  int len = strlen(str);
  bool uniq = true;
  
  for (int i = 0; i &lt;= len; ++i)
      {
          for (int j = i+1; j &lt;= len; ++j)
          {
              if (str[j] == str[i])
              {
                  uniq = false;
              }
          }
      }
  return uniq;
  </code></pre>
  
  <p>}</p>
  
  <p>The program compiles but has some logical errors I suppose. Any help appreciated.</p>