3/06/2014

(C, C++) char * compare, strcmp function


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

int main ()
{
  char szKey[] = "apple";
  if( strcmp (szKey,"apple") == 0)
       printf("same\n");
  else
       printf("different\n");

  
  return 0;
}


No comments:

Post a Comment