c 2b 2b memcmp

Solutions on MaxInterview for c 2b 2b memcmp by the best coders in the world

showing results for - "c 2b 2b memcmp"
Kalia
28 Oct 2020
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}
similar questions
queries leading to this page
c 2b 2b memcmp