title: Passing string as argument
body: <p>//EDITED:
  follow up question:</p>
  
  <p>But making the function as <code>isUnique(const char *s)</code> 
  and then calling function as <code>isUnique(str.c_str())</code>  does not allow me to modify my string <code>str</code> in the function<br>
  //</p>
  
  <p>I am having problem with passing a string:</p>
  
  <pre><code>bool isUnique(char *s)
  {
      int arr[256] = {0};
      while(*s)
      {
          arr[*s]++;
          if(arr[*s]&gt;1)
          {
              cout&lt;&lt;"not unique";
              return false; 
          }
      }
  }
  int main()
  {
      string str = "abcda";
      cout&lt;&lt;"1: True : unique, 2: False: Not Unique"&lt;&lt;endl&lt;&lt;isUnique(str);
  }
  </code></pre>
  
  <blockquote>
    <p>ERROR:cannot convert 'std::string {aka std::basic_string}' to 'char*' for argument '1' to 'bool isUnique(char*)'</p>
  </blockquote>