Standards / Extensions | C or C++ | Dependencies |
---|---|---|
ISO C Amendment |
both |
#include <wchar.h>
wchar_t *wcscat(wchar_t * __restrict__string1, const wchar_t * __restrict__string2);
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-terminated wide-character strings. The string arguments to this function must contain a wide NULL character marking the end of the string. Bounds checking is not performed.
The behavior of this wide-character function is affected by the LC_CTYPE category of the current locale. If you change the category, undefined results can occur.
wcscat() returns the value of string1.
⁄* CELEBW04
This example creates the wide character string "computer
program" using &wcscat..
*⁄
#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 );
}
buffer1 = computer program