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

Discussion

Which of the following function sets first n characters of a string to a given character?

  • A.strinit()
  • B.strnset()
  • C.strset()
  • D.strcset()

Answer: B

Correct answer: strnset()

strnset(s, ch, n) sets the first n characters of the string to the given character, while strset sets every character to the end. Both are non-standard, from the Turbo C and Microsoft libraries; the portable equivalent is memset.

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

Post your comment

Please log in or register to post a comment.