title: C++ Error: no match for call to ‘(std::string {aka std::basic_string<char>}) (unsigned int, char)
body: <p>When I want to use <code>string::s(unsigned, char)</code> to assigned <code>s</code>, the g++ output this error message.</p>
  
  <p>There is my class:</p>
  
  <pre><code>#include &lt;string&gt;
  using std::string;
  
  class Screen()
  {
  private:
      unsigned height = 0, width = 0;
      string contents;
  public:
      Screen(unsigned ht, unsigned wd): height(ht), width(wd) {contents(ht * wd, ‘ ’）；}
  }
  </code></pre>
  
  <p>Why it is wrong? </p>
  
  <p>I know that it should be <code>Screen(unsigned ht, unsigned wd): height(ht), width(wd), contents(ht * wd, ‘ ’）{ }</code>, but why I can't use the function<code>string(unsigned, char)</code> to assigned a value for a string constructed?</p>