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 146 views
146 views asked Jun 22, 2017 by avibootz
1 answer 116 views
116 views asked Aug 7, 2024 by avibootz
1 answer 105 views
105 views asked Aug 7, 2024 by avibootz
2 answers 206 views
1 answer 170 views
170 views asked Jun 22, 2017 by avibootz
1 answer 146 views
1 answer 135 views
...