StrBuf::operator =( const StrRef & )

Assign a StrBuf from a StrRef.

Virtual?

No

 

Class

StrBuf

 

Arguments

const StrRef &s

(implied) reference of the StrRef instance

Returns

void

 

Notes

Initialize the StrBuf and StrRef before assignment.

Any memory allocated for the StrBuf's buffer is separate from that of the StrRef's buffer.

Example

#include <iostream>

#include <stdhdrs.h>
#include <strbuf.h>

int main( int argc, char **argv )
{
    StrRef sr( "xyz" );
    StrBuf sb;

    sb = sr;   // assign StrBuf from StrRef

    cout << "sr.Text() returns \"" << sr.Text() << "\"\n";
    cout << "sb.Text() returns \"" << sb.Text() << "\"\n";
}

Executing the preceding code produces the following output:

sr.Text() returns "xyz"
sb.Text() returns "xyz"