The wcscat() function is specified in header file cwchar.h and this function is use to append a copy of wide string to the end of another string.
Syntax:
wchar_t* wcscat( wchar_t* dest, const wchar_t* src );
Parameters: This function takes two parameters:
- dest: specifies the pointer to the destination array.
- src: specifies the string to be added to the destination.
Return: This function returns the new appended string.
Below program illustrate the above function:-
Example:-
cpp
#include <bits/stdc++.h>
using namespace std;
int main()
{
wchar_t dest[30];
wchar_t src[30];
wcscpy(dest, L "Geekforgeeks " );
wcscpy(src, L "is the best" );
wcscat(dest, src);
wprintf(L "%ls\n" , dest);
return 0;
}
|
Output:
Geekforgeeks is the best
Time Complexity: O(n)
Space Complexity: O(n)
Last Updated :
26 Jun, 2023
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...