Ticket #338: mbstowcs.c

File mbstowcs.c, 406 bytes (added by KO Myung-Hun, 9 years ago)

testcase

Line 
1#include <stdio.h>
2#include <stdlib.h>
3#include <wchar.h>
4#include <locale.h>
5
6int main( void )
7{
8    const char *s = "ÇѱÛ!";
9    wchar_t ws[ 4 ];
10    int n;
11
12    setlocale( LC_ALL, "ko_KR.CP949");
13
14    n = mbstowcs( ws, s, sizeof( ws ));
15
16    printf("mbstowcs() = %d, wcslen() = %d\n", n, wcslen( ws ));
17
18    printf("mbstowcs(NULL) = %d\n", mbstowcs( NULL, s, 0 ));
19
20    return 0;
21}