3.13 Example: unicmp
/* excmp.c - Sample code for unicmp. Case sensitive comparison. */
#include <nunicode.h>
#include <assert.h>
void main(void)
{
nint result;
result = unicmp(L"Cat", L"Cat"); /* zero - strings match exactly */
assert (result == 0);
result = unicmp(L"cat", L"catch"); /* non-zero - no match */
assert (result != 0);
result = unicmp(L"CAT", L"cat"); /* Case-sensitive. No match */
assert (result != 0);
result = unicmp(L"cat", L"dog"); /* Negative - cat < dog */
assert (result < 0);
result = unicmp(L"dog", L"cat"); /* Positive - dog > cat */
assert (result > 0);
}