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

int main() { 
    wchar_t str1[100], str2[100];        
    char *line;
    wchar_t  *retval;
    size_t count;
    int len;
 
    line ="How are you today?";
    count =18;              
    len = strlen(line); 
    mbstowcs(str2, line,len);   
    wcsncpy(str1,str2,count);
    fputws(str1, stdout);
    fputs("\n", stdout);
}

