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

std::wmemmove

Defined in header <cwchar>

wchar_t* wmemmove( wchar_t* dest, const wchar_t* src, std::size_t count );

精确复制count所指向的宽字符数组中的连续宽字符。src指向的宽字符数组dest...

如果count等于零,函数什么也不做。

数组可能会重叠:复制就像宽字符被复制到临时宽字符数组中一样,然后从临时数组复制到dest...

参数

dest

-

pointer to the wide character array to copy to

src

-

pointer to the wide character array to copy from

count

-

number of wide characters to copy

返回值

返回dest...

注记

此函数不区分区域设置,也不注意wchar_t它复制的对象:NULL以及无效字符也被复制。

二次

代码语言:javascript
复制
#include <iostream>
#include <cwchar>
#include <locale>
#include <clocale>
 
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); // copy from [δεζ] to [εζη]
    std::wcout << str << '\n';
}

二次

可能的产出:

二次

代码语言:javascript
复制
αβγδεζηθικλμνξοπρστυφχψω
αβγδδεζθικλμνξοπρστυφχψω

二次

另见

wmemcpy

copies a certain amount of wide characters between two non-overlapping arrays (function)

memmove

moves one buffer to another (function)

copycopy_if (C++11)

copies a range of elements to a new location (function template)

copy_backward

copies a range of elements in backwards order (function template)

C.wmemmove的文档

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

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

扫码关注腾讯云开发者

领取腾讯云代金券