Skip to content

strcmp

Comparing two character arrays

strcmp(s1, s2)

  • s1 and s2 should be arrays of characters.
  • It returns logical 1 if s1 and s2 have the same sizes and have the same elements, and returns logical 0 if otherwise.
  • It returns logical 0 if any of s1 and s2 is not a character array.