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 137 views
137 views asked Jun 22, 2017 by avibootz
1 answer 102 views
102 views asked Aug 7, 2024 by avibootz
1 answer 93 views
93 views asked Aug 7, 2024 by avibootz
2 answers 196 views
1 answer 155 views
155 views asked Jun 22, 2017 by avibootz
1 answer 137 views
1 answer 127 views
...