/* ECP: FILEname=fig14_20.cpp */ /* 1*/ const String & /* 2*/ String::operator = ( const String & Value ) /* 3*/ { /* 4*/ const int Len = strlen( Value.Storage ); /* 5*/ if( this != &Value ) // Do not copy to yourself. /* 6*/ { /* 7*/ if( Len >= StorageLen ) /* 8*/ { /* 9*/ delete [ ] Storage; /*10*/ GetStorage( Len ); /*11*/ } /*12*/ /*13*/ strcpy( Storage, Value.Storage ); /*14*/ } /*15*/ return *this; /*16*/ }