C Run-Time Library Reference
strncmp
compare characters in strings
Synopsis
#include <string.h>
int strncmp(const char *s1, const char *s2, size_t n);
Description
The
function lexicographically compares up to
strncmp
null-terminated strings pointed to by
if the
string is greater than the
s1
is greater than the
Error Conditions
The
function does not return an error condition.
strncmp
Example
#include <string.h>
char *ptr1;
ptr1 = "TEST1";
if (strncmp(ptr1, "TEST", 4) == 0)
printf("%s starts with TEST \n", ptr1);
See Also
memcmp,
strcmp
3-130
string, a negative value if the
s2
string, and a zero if the strings are the same.
s1
VisualDSP++ 3.5 C/C++ Compiler and Library Manual
n
and
. It returns a positive value
s1
s2
for ADSP-219x DSPs
characters of the
string
s2
Need help?
Do you have a question about the VISUALDSP++ 3.5 and is the answer not in the manual?
Questions and answers