DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SVR5

strcmp(D3)


strcmp -- compare strings

Synopsis

   #include <sys/types.h>
   #include <sys/ddi.h>
   

int strcmp(const char *sptr1, const char *sptr2);

Description

The function strcmp compares characters of the string pointed to by sptr1 to the string pointed to by sptr2, up to the first terminating null-character in either string.

Arguments

The arguments sptr1 and sptr2 each point to strings, and each string is an array of characters terminated by a null-character.

Return values

The function strcmp returns an integer value less than, equal to or greater than zero to indicate whether the string pointed to by sptr1 is lexicographically less than, equal to or greater than the null-terminated string pointed to by sptr2.

Usage

The function strcmp uses native character comparison. The sign of the value returned when one of the characters has its high-order bit set is implementation-dependent.

Context and synchronization

All contexts.

Hardware applicability

All

Version applicability

ddi: 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp

References

bcmp(D3), bcopy(D3), strlen(D3), strncmp(D3)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005