You pass no as const , but you are trying to change it.
istream& operator>>(istream& is, const PhoneNumber& no) //-------------------------------^ { int area, local; cout << "Area Code : "; is >> area; cout << "Local number : "; is >> local; no.set(area, local); // <------ return is; }
user1508519
source share