StrRef::StrRef( const char * ) (constructor)

Construct a StrRef, referencing an existing string.

Virtual?

No

 

Class

StrRef

 

Arguments

char *buf

a null-terminated string to reference

Returns

StrRef

 

Notes

If arguments are provided, the constructor calls Set() with them.

Example

#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"