StrRef::Set( const StrPtr * )
Set a StrRef
to reference an existing
StrPtr
.
Virtual? |
No |
|
Class |
||
Arguments |
|
the value to set |
Returns |
|
Notes
StrRef::Set()
does not copy
the target string; it simply establishes a pointer to it. Be sure that
the StrRef
pointing to the target string does not outlive
the target string.
Example
#include <iostream> #include <stdhdrs.h> #include <strbuf.h> int main( int argc, char **argv ) { StrRef sr; sr.Set( "xyz" ); cout << "sr.Text() returns \"" << sr.Text() << "'\"n"; }
Executing the preceding code produces the following output:
sr.Text() returns "xyz"