1. | Which of the following function sets first n characters of a string to a given character? |
|||||||
Answer: Option B Explanation:
Declaration: char *strnset(char *s, int ch, size_t n); Sets the first n characters of s to ch
Output: string before strnset: abcdefghijklmnopqrstuvwxyz string after strnset: xxxxxxxxxxxxxnopqrstuvwxyz |