/* Copyright (c) 2001-2004 by SoftIntegration, Inc. All Rights Reserved */
#include <stdio.h>
#include <stdlib.h>

int main() {
    char s[8]; 
    wchar_t pwcs[8] = L"123abc\n";
    size_t retval;
 
    retval = wcstombs(s,pwcs, wcslen(pwcs)+1);
    if(retval != (size_t) -1) {
        printf("the original string is: ");
        fputws(pwcs, stdout);
    	printf("The converted result is: %s\n",s);
    }
    else
	printf("Error\n");
}
