Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>strcmp</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
strcmp
strcmpl

Usage

   #include <string.h>
   int strcmp(const char *string1,const char *string2);
   int strcmpl(const char *string1,const char *string2);

   ANSI

Description

   strcmp and strcmpl compare two strings, character by character. strcmp is
   case sensitive whereas strcmpl is not.

Example 

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

   char string1[50] = "Example string ";
   char string2[50] = "Example String ";

   int main()
   {
       printf("\nstrcmp example [%d]\n",
               strcmp(string1,string2));
       printf("\nstrcmpl example [%d]\n",
               strcmpl(string1,string2));
       return EXIT_SUCCESS;
   }


Return Value

   < 0              if string1 is less than string2

   = 0              if string1 is equal to string2

   > 0              if string1 is greater than string2

See Also

   memcmp



See Also: memcmp

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson