[#BloombergLP-bdlb-String-copy-01] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/String.adoc[String]::copy :relfileprefix: ../../../ :mrdocs: Return a newly allocated null‐terminated copy of `string`. == Synopses Declared in `<bdlb_string.h>` Return a newly allocated null‐terminated copy of `string`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static char* xref:BloombergLP/bdlb/String/copy-0d.adoc[copy]( xref:bsl/string.adoc[bsl::string] const& string, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator); ---- [.small]#xref:BloombergLP/bdlb/String/copy-0d.adoc[_» more..._]# Return a newly allocated null‐terminated copy of `string`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static char* xref:BloombergLP/bdlb/String/copy-0eb.adoc[copy]( char const* string, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator); ---- [.small]#xref:BloombergLP/bdlb/String/copy-0eb.adoc[_» more..._]# Return a newly allocated null‐terminated copy of `string`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static char* xref:BloombergLP/bdlb/String/copy-0e0.adoc[copy]( char const* string, int length, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator); ---- [.small]#xref:BloombergLP/bdlb/String/copy-0e0.adoc[_» more..._]# == Return Value address of the newly allocated copy == Parameters [cols="1,4"] |=== | Name| Description | *string* | string to copy | *basicAllocator* | allocator used to supply memory | *length* | length of `string` in bytes |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#