Strncmp - HP 68000 Series User Manual

Debugger/simulator
Table of Contents

Advertisement

strncmp

Function
Limited comparison of two strings
Synopsis
unsigned long strncmp (str1, str2, count)
char *str1;
char *str2;
unsigned count;
Description
The strncmp macro compares strings in lexicographic order. Lexicographic
order means that characters are compared based on their internal machine
representation. For example, because an ASCII 'A' is 41 hexadecimal and an
ASCII 'B' is 42 hexadecimal, 'A' is less than 'B'.
The count in the synopsis above specifies the maximum number of characters
to be compared.
The strings str1 and str2 are compared and a result returned according to the
following relations:
relation
s1 < s2
s1 = s2
s1 > s2
Diagnostics
Strings are not required to be NULL terminated or to fit within the array
boundaries because the comparison is limited to the number of stated
characters. Less than count characters will be compared if the strings are
smaller than count characters. The comparison is always signed, regardless of
how the string is declared.
Chapter 11: Predefined Macros
result
negative integer
zero
positive integer
strncmp
477

Advertisement

Table of Contents
loading

This manual is also suitable for:

B1466

Table of Contents