title: How to use const_cast?
body: <p>I have a private variable in my <code>Student</code> class defined as:</p>
  
  <pre><code>const int studentNumnber;
  </code></pre>
  
  <p>I am trying to write a copy constructor for the <code>Student</code> and I need to cast away the constness to do this. Unfortunately, I don't understand how to use <code>std::const_cast</code>.</p>
  
  <p>This is what I am trying to do in my copy constructor:</p>
  
  <pre><code>    Student(const Student &amp; s) 
          : Person(p.getName(), p.getEmailAddress(), p.getBirthDate()), school(0), studentNumber(0) {
          school = new char[strlen(s.school) + 1];
          strcpy_s(school, strlen(s.school) + 1, s.school);
          const_cast&lt;int*&gt;(this)-&gt;studentNumber = s.studentNumber;
          //studentNumber = s.studentNumber);
      }
  </code></pre>
  
  <p>That doesn't work... I am unsure of the syntax.</p>