Putting it all together
String&
String::operator=(const String& s)
{
if (this != &s) {
delete[] data;
data = new char[strlen(s.data)+1];
strcpy(data, s.data);
}
return *this;
}
Previous slide
Next slide
Back to first slide
View graphic version