StrRef::operator =( StrPtr & )
Set a StrPtr
to reference an existing StrPtr
or null-terminated string.
Virtual? |
No |
|
Class |
||
Arguments |
|
the |
Returns |
|
Notes
The =
operator is equivalent to calling Set()
.
Example
Copy
#include <iostream>
#include <stdhdrs.h>
#include <strbuf.h>
int main( int argc, char **argv )
{
StrBuf str1;
str1.Set( "xyz" );
StrRef sr = str1;
cout << "str1 = \"" << str1.Text() << "\"\n";
cout << "sr.Text() returns \"" << sr.Text() << "\"\n";
}
Executing the preceding code produces the following output:
str1 = "xyz" sr.Text() returns "xyz"