/* Copyright (c) 2001-2004 by SoftIntegration, Inc. All Rights Reserved */
/* This is an example of the function wcswidth(const wchar_t*, size_t).  This
   returns the number of characters needed to represent the string or the 
   specified width if the length of the string exceeds it.
*/
#include <wchar.h>
#include <stdlib.h>

int main() {
    char *line;
    wchar_t str1[100];        
    size_t width;
    int retval,len;
    width = 4;
    line = "hello";
    len = strlen(line);

    mbstowcs(str1, line, len);
    retval = wcswidth(str1, width);
    printf("wcswidth(str1,width) = %d\n", retval);
}

