首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::basic_string::push_back

void push_back( CharT ch );

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

Parameters

ch

-

the character to append

Return value

(none).

Complexity

Amortized constant.

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.

See also

pop_back (C++11)

removes the last character (public member function)

代码语言:txt
复制
 © cppreference.com

Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.

扫码关注腾讯云开发者

领取腾讯云代金券