std:: wmemmove
From zh.cppreference.net
C++
Text processing library
| Localization library | |||||||||||||||||||||||||
| Regular expressions library (C++11) | |||||||||||||||||||||||||
| Formatting library (C++20) | |||||||||||||||||||||||||
| Null-terminated sequence utilities | |||||||||||||||||||||||||
| Byte strings | |||||||||||||||||||||||||
| Multibyte strings | |||||||||||||||||||||||||
| Wide strings | |||||||||||||||||||||||||
| Primitive numeric conversions | |||||||||||||||||||||||||
|
|||||||||||||||||||||||||
| Text encoding identifications | |||||||||||||||||||||||||
|
|||||||||||||||||||||||||
Null-terminated wide strings
| Functions | ||||||||||||||||||||||||||
| Character classification | ||||||||||||||||||||||||||
| Character manipulation | ||||||||||||||||||||||||||
| Conversions to numeric formats | ||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||
| String manipulation | ||||||||||||||||||||||||||
| String examination | ||||||||||||||||||||||||||
| Array manipulation | ||||||||||||||||||||||||||
|
定义于头文件
<cwchar>
|
||
|
wchar_t
*
wmemmove
(
wchar_t
*
dest,
const
wchar_t
*
src,
std::
size_t
count
)
;
|
||
从由 src 指向的宽字符数组中,精确复制 count 个连续宽字符到由 dest 指向的宽字符数组。
如果 count 为零,该函数不执行任何操作。
数组可能重叠:复制操作的过程类似于先将宽字符复制到一个临时宽字符数组,然后再从临时数组复制到 dest 。
内容参数
返回值返回 dest 的副本。 注释此函数对区域设置不敏感,且不关注所复制的 wchar_t 对象值:空字符及无效字符均会被复制。 示例
运行此代码
#include <clocale> #include <cwchar> #include <iostream> #include <locale> int main() { std::setlocale(LC_ALL, "en_US.utf8"); std::wcout.imbue(std::locale("en_US.utf8")); wchar_t str[] = L"αβγδεζηθικλμνξοπρστυφχψω"; std::wcout << str << '\n'; std::wmemmove(str + 4, str + 3, 3); // 从 [δεζ] 复制到 [εζη] std::wcout << str << '\n'; } 可能的输出: αβγδεζηθικλμνξοπρστυφχψω αβγδδεζθικλμνξοπρστυφχψω 参阅
| |||||||||||||||||||||||