std::basic_string::push_back - cppreference.com

##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::basic_string::push_back

From cppreference.com
< cpp‎ | string‎ | basic string

void push_back( CharT ch ); |  |

Appends the given character `ch` to the end of the string.

### [edit] Parameters

ch | - | the character to append

### [edit] Return value

(none)

### [edit] Complexity

Amortized constant.

### [edit] Exceptions

If an exception is thrown for any reason, this function has no effect (strong exception guarantee). (since C++11)

If the operation would result in `size() > max_size()`, throws std::length_error.

### [edit] See also

pop_back (C++11) | removes the last character (public member function) [edit]

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/string/basic_string/push_back&oldid=66404"