#include <stdlib.h>
#include <limits.h>
#include <stdlib.h>
 
int main(void) {
    char    s[128];
    wchar_t *wc = (wchar_t *)malloc(8 * sizeof(wchar_t));
    int     n;
 
    setlocale(LC_ALL, "");
    wcscpy(wc, L"ABCDEF");
 
    if ((n = wctomb(s, wc)) == -1) {
        perror("wctomb failed");
        exit(-1);
    }
    
    printf("Bytes contained in multibyte character array: %d\n", n);
    return (0);
}
