I have a private variable in my Student class defined as:
const int studentNumnber;
I am trying to write a copy constructor fo
In your code you are trying cast this pointer instead of variable. You can try the following:
Student(const Student & 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(&studentNumber) = s.studentNumber;
}