wcscat, wcscat_s

Header: <wchar.h>

  1. Appends a copy of the wide string pointed to by src to the end of the wide string pointed to by dest. The wide character src[0] replaces the null terminator at the end of dest. The resulting wide string is null-terminated. The behavior is undefined if the destination array is not large enough for the contents of both str and dest and the terminating null wide character. The behavior is undefined if the strings overlap.

# Declarations

wchar_t *wcscat( wchar_t *dest, const wchar_t *src );

(since C95) (until C99)

wchar_t *wcscat( wchar_t *restrict dest, const wchar_t *restrict src );

(since C99)

errno_t wcscat_s( wchar_t *restrict dest, rsize_t destsz,
const wchar_t *restrict src );

(since C11)

# Parameters

# Example

#include <wchar.h> 
#include <stdio.h>
#include <locale.h>
 
int main(void) 
{
    wchar_t str[50] = L"Земля, прощай.";
    wcscat(str, L" ");
    wcscat(str, L"В добрый путь.");
    setlocale(LC_ALL, "en_US.utf8");
    printf("%ls", str);
}

# See also