GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::wcscpy(3) C++ Standard Libary std::wcscpy(3)

std::wcscpy - std::wcscpy


Defined in header <cwchar>
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.


dest - pointer to the wide character array to copy to
src - pointer to the null-terminated wide string to copy from


dest

// Run this code


#include <iostream>
#include <cwchar>
#include <memory>
#include <clocale>


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';
}


犬 means dog
狗 means dog


wcsncpy copies a certain amount of wide characters from one string to another
(function)
copies a certain amount of wide characters between two non-overlapping
wmemcpy arrays
(function)
strcpy copies one string to another
(function)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.