This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/WATCOM/samples/clibexam/mbstowcs.c

19 lines
360 B
C
Raw Normal View History

#include <stdio.h>
#include <stdlib.h>
void main()
{
char *wc = "string";
wchar_t wbuffer[50];
int i, len;
len = mbstowcs( wbuffer, wc, 50 );
if( len != -1 ) {
wbuffer[len] = '\0';
printf( "%s(%d)\n", wc, len );
for( i = 0; i < len; i++ )
printf( "/%4.4x", wbuffer[i] );
printf( "\n" );
}
}