Compare a specified number of characters.
Compatibility:This function is compatible with the following targets:
|
|
#include <string.h>
int strncmp(const char *s1,  
const char *s2, size_t n);
Parameters for this facility are:
#include <string.h>
#include <stdio.h>
int main(void)
{
static char s1[] = "12345anchor", s2[] = "12345zebra";
if (strncmp(s1, s2, 5) == 0)
printf("%s is equal to %s\n", s1, s2);
else
printf("%s is not equal to %s\n", s1, s2);
return 0;
}
Output:
12345anchor is equal to 12345zebra
[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.
Last updated: August 16, 2000