Crossware

Table of Contents        Previous topic       Next topic       

COMPILER LIBRARY FUNCTIONS->Detailed Descriptions->strncmp()

Summary

#include <string.h>

    
char *strncmp(const char* string1, const char* string2, size_t n);Compare one string with another

Parameters

    
string1Pointer to first string
string2Pointer to second string
nNumber of characters to compare

Description

This function lexicographically compares the first n characters of string2 with string1.


Return Value
    
ValueMeaning
Less than 0sub-string1 less than sub-string2
0sub-string1 identical to sub-string2
Greater than 0sub-string1 greater than sub-string2