| Home | Libraries | People | FAQ | More

###### string::operator= (3 of 4 overloads)

Assign a value to the string.

###### Synopsis

    string&
    operator=(
        char const* s);

###### Description

Replaces the contents with those of the null terminated string pointed to by `s`. The length of the string is determined by the first null character.

###### Complexity

Linear in `std::strlen(s)`.

###### Exception Safety

Strong guarantee. Calls to `memory_resource::allocate` may throw.

###### Return Value

`*this`

###### Parameters

Name | Description
--- | ---
`s` | The null-terminated character string.

###### Exceptions

Type | Thrown On
--- | ---
`system_error` | `std::strlen(s) > max_size()`.