Top

Discussion

Which among the given options compares atmost n characters of string ch to string s?

  • A.int strncmp(ch, s, n)
  • B.int strcmp(ch, s)
  • C.int strncmp(s, ch, n)
  • D.int strcmp(s, ch)

Answer: A

int strncmp(ch, s, n) is used to compare at most n characters of string ch to string s; return <0>s.

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

Post your comment