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

29 lines
472 B
C

#include <stdio.h>
#include <mbctype.h>
#include <mbstring.h>
unsigned char mb1[2] = {
0x41, 0x42
};
unsigned char mb2[2] = {
0x61, 0x43
};
void main()
{
int i;
_setmbcp( 932 );
i = _mbcicmp( mb1, mb2 );
if( i == _NLSCMPERROR )
printf( "Error in multibyte character\n" );
else if( i < 0 )
printf( "Less than\n" );
else if( i == 0 )
printf( "Equal to\n" );
else
printf( "Greater than\n" );
}