1/* memcmp example */
2#include <stdio.h>
3#include <string.h>
4
5int main ()
6{
7 char buffer1[] = "DWgaOtP12df0";
8 char buffer2[] = "DWGAOTP12DF0";
9
10 int n;
11
12 n=memcmp ( buffer1, buffer2, sizeof(buffer1) );
13
14 if (n>0) printf ("'%s' is greater than '%s'.\n",buffer1,buffer2);
15 else if (n<0) printf ("'%s' is less than '%s'.\n",buffer1,buffer2);
16 else printf ("'%s' is the same as '%s'.\n",buffer1,buffer2);
17
18 return 0;
19}