The C function ________ is used to compare two strings lexicographically.

  • strcmp
  • strncmp
  • strcompare
  • strcasecmp
The correct answer is strcmp. This function compares two strings character by character and returns an integer value representing their lexicographical order. strncmp is used for comparing a specific number of characters, and the other options are not valid C functions.
Add your answer
Loading...

Leave a comment

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