How to copy wide character string to another in C++

1 Answer

0 votes
#include <iostream>
#include <cwchar>

int main() {
    wchar_t str[] = L"c++ programming";
    wchar_t str_copy[32];
    
    wcscpy(str_copy, str);
    
    std::wcout << str_copy;
}




/*
run:

c++ programming

*/

 



answered Nov 27, 2022 by avibootz

Related questions

1 answer 203 views
203 views asked Aug 7, 2024 by avibootz
1 answer 188 views
188 views asked Aug 7, 2024 by avibootz
1 answer 213 views
213 views asked Jun 22, 2017 by avibootz
1 answer 197 views
1 answer 205 views
1 answer 215 views
...