Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

index(3)

rindex(3)

strcat(3)

strchr(3)

strcspn(3)

strcpy(3)

strlen(3)

strncat(3)

strncmp(3)

strncpy(3)

strpbrk(3)

strrchr(3)

strspn(3)



  strcmp(3)                           CLIX                           strcmp(3)



  NAME

    strcmp - Compares two strings

  LIBRARY

    Standard C Library (libc.a)

  SYNOPSIS

    #include <string.h>

    int strcmp(
      char * string1 ,
      char * string2 );

  PARAMETERS

    string1
           A pointer to a character string

    string2
           A pointer to a character string

  DESCRIPTION

    Upon successful completion, the strcmp() function returns an integer whose
    value is greater than, equal to, or less than 0 (zero), according to
    whether the string1 string is greater than, equal to, or less than the
    string2 string.

  EXAMPLES

    #include <stdio.h>
    #include <string.h>

    main()
    {
         if (!strcmp("abc", "def"))
              printf("The strings are equal\n");
         else
              printf("The strings are not equal\n");
    }


  RELATED INFORMATION

    Functions: index(3), rindex(3), strcat(3), strchr(3), strcspn(3),
    strcpy(3), strlen(3), strncat(3), strncmp(3), strncpy(3), strpbrk(3),
    strrchr(3), strspn(3)




  2/94 - Intergraph Corporation                                              1




Typewritten Software • bear@typewritten.org • Edmonds, WA 98026