/* Copyright (c) 2001-2004 by SoftIntegration, Inc. All Rights Reserved */
/* This is an example of the function wmemmove(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, *line2;
    wchar_t  *retval;
    size_t count;
    int len;

    line ="What is your name?";
    count =15;
    len = strlen(line);
    retval = wmemmove(str1,str2,count);
    if(retval != NULL) {
    	printf("Original line: %s\n", line );
    	mbstowcs(str2, line,len);
    	printf("Number of characters to move: %d",count); 
    	printf("\nNew string1: ");
    	fputws(wmemmove(str1, str2, count), stdout);
    	fputs("\n", stdout);
    }
    else
        printf("Error\n");
}

