Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which of the following functions returns a pointer to the located string or a null pointer if string is not found.

  • A.strtok()
  • B.strstr()
  • C.strspn()
  • D.strrchr()

Answer: B

Correct answer: strstr()

strstr(haystack, needle) searches for the first occurrence of one string inside another and returns a pointer to where it begins, or NULL if it is not there. strchr finds a single character rather than a string.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.