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/setlocal.c

19 lines
349 B
C

#include <stdio.h>
#include <string.h>
#include <locale.h>
char src[] = { "A sample STRING" };
char dst[20];
void main()
{
char *prev_locale;
size_t len;
/* set native locale */
prev_locale = setlocale( LC_ALL, "" );
printf( "%s\n", prev_locale );
len = strxfrm( dst, src, 20 );
printf( "%s (%u)\n", dst, len );
}