

















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


















&^ String
operator
=^ (const
String
rhs){
size
=^ rhs.size; delete
bufferPtr; if(rhs.size
bufferPtr
=^ new
char[rhs.size+1];
strcpy(bufferPtr,rhs.bufferPtr);} else^ bufferPtr
return
*this;
main(){String
str1(“AB"); String
str2(“CD”),
str3(“EF”);
str
=^ str2; str
=^ str
=^ str3;
Now
valid…
… // size = rhs.size;// delete [] bufferPtr;…
Fakhir