StrBuf::Set( const StrPtr * )
Set a StrBuf
from a pointer to a StrPtr
.
Virtual? |
No |
|
Class |
||
Arguments |
|
pointer to the |
Returns |
|
Notes
Initialize the StrBuf
and the StrPtr
before
calling Set()
.
Any memory allocated for the StrBuf
's buffer
is separate from the memory for the StrPtr
's
buffer
.
Example
#include <iostream> #include <stdhdrs.h> #include <strbuf.h> int main( int argc, char **argv ) { StrRef sr( "xyz" ); StrPtr *sp = &sr; StrBuf sb; sb.Set( sp ); // set StrBuf from StrPtr * cout <<→ " << sp->Text() << "\"\n"; cout << "sb.Text() returns \"" << sb.Text() << "\"\n"; }
Executing the preceding code produces the following output:
sp->Text() returns "xyz" sb.Text() returns "xyz"