C / string.h / strncmp
memchr, memcmp, memcpy, memmove, memset, strcat, strchr, strcmp, strcoll, strcpy, strcspn, strerror, strlen, strncat, » strncmp, strncpy, strpbrk, strrchr, strspn, strstr, strtok, strxfrm,
Funcion: strncmp()
Sintaxis:
int strncmp(const char *s1, const char *s2, size_t n);

Descripcion: Compara no más de n caracteres (caracteres posteriores al carácter nulo no se tienen en cuenta) de la cadena apuntada por s1 con la cadena apuntada por s2.


Ejemplo:
#include <stdio.h>
#include <string.h>
 
int main()
{
   char s1[9] = "artesano";
   char s2[8] = "artista";
   int i;
 
   printf( "s1=%s\t", s1 );
   printf( "s2=%s\n", s2 );
 
   i = strncmp( s1, s2, 3 );
   printf( "Las 3 primeras letras de s1 son " );
   if( i < 0 )  printf( "menores que" );
   else if( i > 0 )  printf( "mayores que" );
   else  printf( "iguales a" );
   printf( " s2\n" );
 
   return 0;
}

Librerias C

Librerias ANSI C
   string.hcstring
   math.hcmath
   stdio.hcstdio
   time.hctime
   stdlib.hcstdlib
   ctype.hcctype
   locale.hclocale
   signal.hcsignal
   setjmp.hcsetjmp

Librerias Borland
   conio.h
   graphics.h