/* Copyright (c) 2001-2009 by SoftIntegration, Inc. All Rights Reserved */
/* This is an example of the function wcsncat(wchar_t*, const wchar_t*, size_t).   
    This function appends the specified number of characters from str2 to str1.
*/
#include <wchar.h>
#include <stdlib.h>

int main() { 
    wchar_t str1[100], str2[100];        
    char *line, *line2;
    wchar_t  *retval;
    size_t count;
    int len1,len2;
 
    line = "Hello, ";
    line2 ="how are you today?";
    len1 = strlen(line);
    len2 = strlen(line2);
    count =18;              
    mbstowcs(str1, line, len1);   
    mbstowcs(str2, line2, len2);   
    wcsncat(str1,str2,count);
    fputws(str1, stdout);
    fputs("\n", stdout);
}

