Which function would you use to compare two strings lexicographically in C?

  • strcat()
  • strcmp()
  • strcpy()
  • strlen()
You would use the strcmp() function to compare two strings lexicographically in C. It returns 0 if the strings are equal, a positive value if the first string is greater, and a negative value if the second string is greater.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *