Which of the following function sets first n characters of a string to a given character?
A. strinit()
B. strnset()
C. strset()
D. strcset()
Answers
Answered by
1
Answer:
B
Explanation:
char *string = "qwertyuiopasdfghjklzxcvbnm";
char letter = 'x';
...
strnset(string, letter, 13);
Answered by
1
Answer:
The correct option is B. strnset()
Explanation:
char *strnset(char *s, int ch, size_t n); Sets the first n characters of s to ch
#include <stdio.h>
#include <string.h>
int main(void)
{
char *string = "abcdefghijklmnopqrstuvwxyz";
char letter = 'x';
printf("string before strnset: %s\n", string);
strnset(string, letter, 13);
printf("string after strnset: %s\n", string);
return 0;
}
String functionality To get the number of characters in a string, use String Length().
- A string is any character enclosed in double quotation marks in any computer language.
- A string's length is another name for how many characters make up the string.
- In order to determine the number of alphabets, numerals, or special characters included in a given string variable, we may use the function "String Length()".
learn more about it
brainly.in/question/24019408
brainly.in/question/8003487
#SPJ3
Similar questions
Computer Science,
3 months ago
Math,
3 months ago
Math,
3 months ago
Science,
7 months ago
Social Sciences,
7 months ago
English,
1 year ago