std:: wmemset
From ko.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
*
wmemset
(
wchar_t
*
dest,
wchar_t
ch,
std::
size_t
count
)
;
|
||
와이드 문자 ch 를 dest 가 가리키는 와이드 문자 배열의 첫 count 개 와이드 문자 각각에 복사합니다.
오버플로우가 발생할 경우, 그 동작은 정의되지 않습니다.
만약 count 가 0이면, 함수는 아무 작업도 수행하지 않습니다.
목차매개변수
반환값dest 의 복사본을 반환합니다. 참고 사항이 함수는 로캘에 민감하지 않으며 기록하는 wchar_t 객체의 값에 주의를 기울이지 않습니다: null 및 유효하지 않은 와이드 문자도 기록됩니다. 예제
이 코드 실행
#include <clocale> #include <cwchar> #include <iostream> #include <locale> int main() { wchar_t ar[4] = {L'1', L'2', L'3', L'4'}; std::wmemset(ar, L'\U0001f34c', 2); // replaces [12] with the 🍌 bananas std::wmemset(ar + 2, L'蕉', 2); // replaces [34] with the 蕉 bananas std::setlocale(LC_ALL, "en_US.utf8"); std::wcout.imbue(std::locale("en_US.utf8")); std::wcout << std::wstring(ar, 4) << '\n'; } 가능한 출력: 🍌🍌蕉蕉 참고 항목
| |||||||||||||||||||