StrRef::StrRef( const char * ) (constructor)
Construct a StrRef
, referencing an existing string.
Virtual? |
No |
|
Class |
||
Arguments |
|
a null-terminated string to reference |
Returns |
|
Notes
If arguments are provided, the constructor calls Set()
with them.
Example
Copy
#include <iostream>
#include <stdhdrs.h>
#include <strbuf.h>
int main( int argc, char **argv )
{
char chars[] = "abc";
StrRef sr = StrRef( chars );
cout << "chars[] = \"" << chars << "\"\n";
cout << "sr.Text() returns \"" << sr.Text() << "\"\n";
}
Executing the preceding code produces the following output:
chars[] = "abc" sr.Text() returns "abc"