[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    strcmp(9F) manual page Table of Contents

Name

strcmp, strncmp - compare two null terminated strings.

Synopsis

#include <sys/ddi.h>

int strcmp(const char *s1, const char *s2);

int strncmp(const char *s1, const char *s2, size_t n);

Interface Level

Solaris DDI specific (Solaris DDI).

Arguments

s1, s2
Pointers to character strings.
n
Count of characters to be compared.

Description

strcmp()

strcmp() returns 0 if the strings are the same, or the integer value of the expression (*s1 - *s2) for the last characters compared if they differ.

strncmp()

strncmp() returns 0 if the first n characters of s1 and s2 are the same, or (*s1 - *s2) for the last characters compared if they differ.

Return Values

strcmp() returns 0 if the strings are the same, or (*s1 - *s2) for the last characters compared if they differ.

strncmp() returns 0 if the first n characters of strings are the same, or (*s1 - *s2) for the last characters compared if they differ.

Context

These functions can be called from user or interrupt context.

See Also


Table of Contents