Return a newly allocated null‐terminated copy of string.

Synopses

Declared in <bdlb_string.h>

Return a newly allocated null‐terminated copy of string.

static
char*
copy(
    bsl::string const& string,
    bslma::Allocator* basicAllocator);

Return a newly allocated null‐terminated copy of string.

static
char*
copy(
    char const* string,
    bslma::Allocator* basicAllocator);

Return a newly allocated null‐terminated copy of string.

static
char*
copy(
    char const* string,
    int length,
    bslma::Allocator* basicAllocator);

Return Value

address of the newly allocated copy

Parameters

Name

Description

string

string to copy

basicAllocator

allocator used to supply memory

length

length of string in bytes

Created with MrDocs