wcscat() — Concatenate Wide-Character Strings
Format
#include <wchar.h>
wchar_t *wcscat(wchar_t *string1, const wchar_t *string2);
Language Level
XPG4
Threadsafe
Yes
Wide Character Function
See Wide Characters for more information.
Description
The wcscat()
function
appends a copy of the string pointed to by string2 to
the end of the string pointed to by string1.
The wcscat()
function
operates on null-ended wchar_t strings. The string arguments
to this function should contain a wchar_t null character
marking the end of the string. Boundary checking is not performed.
Return Value
The wcscat()
function
returns a pointer to the concatenated string1.
Example
This example creates the wide character
string "computer program" using the
wcscat()
function.
#include <stdio.h>
#include <wchar.h>
#define SIZE 40
int main(void)
{
wchar_t buffer1[SIZE] = L"computer";
wchar_t * string = L" program";
wchar_t * ptr;
ptr = wcscat( buffer1, string );
printf( "buffer1 = %ls\n", buffer1 );
}
/**************** Output should be similar to: ******************
buffer1 = computer program
******************************************************************/
Related Information
- strcat() — Concatenate Strings
- strncat() — Concatenate Strings
- wcschr() — Search for Wide Character
- wcscmp() — Compare Wide-Character Strings
- wcscpy() — Copy Wide-Character Strings
- wcscspn() — Find Offset of First Wide-Character Match
- wcslen() — Calculate Length of Wide-Character String
- wcsncat() — Concatenate Wide-Character Strings
- <wchar.h>