/* Copyright (c) 2001-2004 by SoftIntegration, Inc. All Rights Reserved */
/* This is an example of the function mbrlen(const char*, size_t, mbstate_t).  
   This returns a value between zero and length.
*/
#include <wchar.h>
#include <stdlib.h>

int main() { 
    char *str;
    size_t retval, length;
    mbstate_t *ps;
   
    str = "hello";
    ps = NULL;
    length = 5;
    retval = mbrlen(str, length, ps);
    if(retval != (size_t) -1) {
    	printf("Number of bytes of next character:  %d\n", retval);
    }
    else
        printf("Error\n");
}

