Compare the first N characters of two strings.
int strncmp( LPCSTR lpcszString1, LPCSTR lpcszString2, size_t count )
Returns an integer < 0 if the first N characters of string1 are alpha-numerically less than
string2, returns 0 if the first N characters of string1 are the same as string2, and returns
an integer > 0 if the first N characters of string1 are alpha-numerically greater than string2.
EX1
void strncmp_ex1() { char str1[] = "Hello!!!"; char str2[] = "Hello"; int nRet = strncmp(str1 , str2 , 5); // compare "Hello" out_int("nRet=", nRet); //output 0 nRet = strncmp(str1 , str2 , 6); out_int("nRet=", nRet); //output 1 }
lstrcmp
origin.h