wchar_t* wcscpy( wchar_t* dest, const wchar_t* src );
Copies the wide string pointed to by src (including the terminating null wide character) to wide character array pointed to by dest.
If the strings overlap, the behavior is undefined.
[edit] Parameters dest - pointer to the wide character array to copy to src - pointer to the null-terminated wide string to copy from [edit] Return valuedest
[edit] Example#include <clocale> #include <cwchar> #include <iostream> #include <memory> int main() { const wchar_t* src = L"ç¬ means dog"; // src[0] = L'ç'; // can't modify string literal auto dst = std::make_unique<wchar_t[]>(std::wcslen(src) + 1); // +1 for the null std::wcscpy(dst.get(), src); dst[0] = L'ç'; std::setlocale(LC_ALL, "en_US.utf8"); std::wcout.imbue(std::locale("")); std::wcout << src << '\n' << dst.get() << '\n'; }
Output:
ç¬ means dog ç means dog[edit] See also copies a certain amount of wide characters from one string to another
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4