How to copy wide character strings in C

1 Answer

0 votes
#include <stdio.h>
#include <wchar.h>
 
#define SIZE 64
 
int main(void)
{
  wchar_t source[SIZE] = L"source string";
  wchar_t destination[SIZE] = L"destination string";

  wchar_t* return_string = wcscpy(destination, source);
  
  printf("destination = %ls\n", destination);
}


 
/*
run:
 
destination = source string

*/

 



answered Aug 7, 2024 by avibootz

Related questions

1 answer 217 views
217 views asked Jun 22, 2017 by avibootz
1 answer 208 views
208 views asked Aug 7, 2024 by avibootz
1 answer 239 views
1 answer 179 views
179 views asked Aug 7, 2024 by avibootz
2 answers 301 views
1 answer 250 views
250 views asked Jun 22, 2017 by avibootz
1 answer 211 views
...