C Programming/wchar.h/wcscat

In C, the function wcscat is included in header file wchar.h. This function is quite similar to strcat.

This function is used to concatenate two wide character strings.

Syntax
wchar_t *wcscat(wchar_t *a, const wchar_t *b);
 * 1) include 

Description
The job done by the functions strcat and Wcscat  is same as mentioned i.e concatenating two strings.. The difference is that the function strcat takes (normal) character strings  and wcscat takes wide character strings as arguments.

The function wcscat ,copy the wide character string say b including '\0'(at the end of string b), at the end of  wide character string say a. The '\0' character of the string a is replaced by the first character of the string 'b'. I.e function append the sring 'b' to the end of string 'a'. If wide character string 'a' is "hello" and  wide character string 'b' is "world". After calling the function wcscat(a, b) , string 'a' becomes "helloworld" and string 'b' remains same. The wide string 'a' must have memory of  at least  (strlen(a) + strlen(b) +1) bytes so that it can  store wcs(Wide character string) 'a', wcs 'b' and '\0'.

Sample Program
Output of program will be ' Hello World '.

Wide character string 'source'(World) is appended at the end of wide character string 'destination'(Hello).

Return Value
The function wcscat returns pointer to wide character string 'a' i.e pointer to the string which is concatenated.