In a database application, you need to sort a list of names (strings) in alphabetical order. Which string handling function might be useful in this scenario?

  • strchr
  • strcmp
  • strnlen
  • strtok
To sort a list of names in alphabetical order, the strcmp function is useful. It compares two strings and returns a value indicating their relative order. strtok is used for tokenizing strings, strchr searches for a character in a string, and strnlen provides the length of a string up to a specified limit.
Add your answer
Loading...

Leave a comment

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