Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

strcmp(9F)

NAME

strcmp, strncmp − compare two null terminated strings. 

SYNOPSIS

#include <sys/ddi.h>
int strcmp(char ∗s1, char ∗s2);
int strncmp(char ∗s1, char ∗s2, size_t n);

ARGUMENTS

s1, s2 Pointers to character strings. 

n Count of characters to be compared. 

INTERFACE LEVEL

SPARC architecture specific (SPARC DDI). 

DESCRIPTION

strcmp()

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

strncmp()

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

RETURN VALUES

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

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

CONTEXT

These functions can be called from user or interrupt context. 

SunOS 5.1/SPARC  —  Last change: 11 Apr 1991

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026