在线文档教程
C++
字符串 | Strings

std::char_traits::assign

STD::CHAR[医]特征::分配

(1)
static void assign( char_type& r, const char_type& a (until C++17)
static constexpr void assign( char_type& r, const char_type& a (since C++17)
static char_type* assign( char_type* p, std::size_t count, char_type a (2)

指派一个角色。

1%29分配字符a对性格r...

2%29分配字符a中的每个字符count所指向的字符序列中的字符。p...

参数

a-character value to assign
r-character to assign to
p-pointer to a character sequence to assign to
count-the length of the character sequence

返回值

1%29%280%29

2%29p

例外

1%29

(none)(until C++11)
noexcept specification: noexcept(since C++11)

2%29%280%29

复杂性

1%29常数。

2%29线性count

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cppreference.com/w/cpp/string/char[医]性状/分配