title: 'this' argument has type const but function is not marked const
body: <p>Okay so I'm a bit of a noob at C++ and in my second assignment I am required to make classes with public and private arguments etc, etc. Basically the mutator functions won't work because apparently they're not of type const?</p>
  
  <p>This is the header file with the class:</p>
  
  <pre><code>class Customer {
  
  private:
      string PhoneNumber_;
      string Name_;
      string Address_;
  
  public:
      string get_PhoneNumber() const {return PhoneNumber_;} // Accessor
      const void set_PhoneNumber(unsigned x) {PhoneNumber_ = x;} // Mutator
  
      string get_Name() const {return Name_;}
      const void set_Name(unsigned x) {Name_ = x;}
  
      string get_Address() const {return Address_;}
      const void set_Address(unsigned x)  {Address_ = x;}
  };
  
  // declare the CreateCustomer function prototype with default values
  Customer* CreateCustomer(const string&amp; id = BLANK, const string&amp; name = BLANK, const string&amp; address = BLANK);
  
  Customer* CreateCustomer(const string&amp; id, const string&amp; name, const string&amp; address) {
      Customer* temp = new Customer();
  
      temp-&gt;get_PhoneNumber() = id; // Due to the Accessors and Mutators PhoneNumber, Name and Address are now functions
      temp-&gt;get_Name() = name;
      temp-&gt;get_Address() = address;
  
      return temp;
  }
  </code></pre>
  
  <p>And this is the error I get in the main.cpp file:</p>
  
  <pre><code>cout &lt;&lt; "\n\nDear ";
      cout &lt;&lt; Charge[0].Holder.set_Name() &lt;&lt; " (" &lt;&lt; Charge[0].Holder.set_PhoneNumber() &lt;&lt; ")";  //  DisplayCustomer(customer) ;
  
      cout &lt;&lt; ",\n" &lt;&lt; Charge[0].Holder.set_Address() &lt;&lt; "\n\n"
  </code></pre>
  
  <p>Basically, the exact error message is: </p>
  
  <blockquote>
    <p>Member function 'set_Name' not viable: 'this' argument has type 'const
    Customer', but function is not type const</p>
  </blockquote>
  
  <p>It happens with set_PhoneNumber and set_Address as well. Any help would be greatly appreciated! Thanks!</p>
  
  <p><strong>UPDATE:</strong> I got it working. Thanks everyone for helping me out!</p>