strncmp function


strncmp will test at most 'n' characters in s1 to s2 for equallity.

Library: string.h
Prototype: int strncmp(const char *s1, const char *s2, int n);
Syntax:	 char string1[]="red dwarf";
	 char string2[]="red";
 strncmp(string1, string2, 3);
Returns :
 <0 if s1 is less than s2 0 if s1 == s2> 0 if s1 > s2

Could do with more explanation....


See Also:

strcmp

o strcasecmp Compare strings, ignoring case.

toupper

tolower

Strings



Martin Leslie

AltStyle によって変換されたページ (->オリジナル) /