Go to the first, previous, next, last section, table of contents.


strncmp

Syntax

#include <string.h>

int strncmp(const char *s1, const char *s2, size_t max);

Description

This function compares up to max characters of s1 and s2.

Return Value

Zero if the strings are equal, a positive number if s1 comes after s2 in the ASCII collating sequense, else a negative number.

Portability

ANSI, POSIX

Example

if (strncmp(arg, "-i", 2) == 0)
  do_include();


Go to the first, previous, next, last section, table of contents.