[#BloombergLP-bslstl-StringRefImp-0c-assign-023]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/StringRefImp-0c.adoc[StringRefImp]::assign
:relfileprefix: ../../../
:mrdocs:

Bind this string reference to a null&hyphen;terminated C string&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;stringref&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
assign(CHAR&lowbar;TYPE const* data);
----

== Description

Bind this string reference to the string at the specified `data` address and extending for `std&colon;&colon;char&lowbar;traits&lt;CHAR&lowbar;TYPE&gt;&colon;&colon;length(data)` characters&period; The string at the `data` address must remain valid as long as it is bound to this string reference&period; The behavior is undefined unless `data` is null&hyphen;terminated&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *data*
| null&hyphen;terminated character string to reference
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
