Is there any function declared as strstr()?
Answer: A
This function returns a pointer to the first occurrence in s1 of any of the entire sequence of characters specified in s2, or a null pointer if the sequence is not present in s1.
char *strstr(const char *s1, const char *s2)
Enter details here
Which among the following is Copying function?
Answer: A
The memcpy() function is used to copy n characters from the object.
The code is void *memcpy(void *s1,const void *s2, size_t n).
Enter details here
The ______ function appends not more than n characters.
Answer: C
The strncat() function appends not more than n characters from the array(s2) to the end of the string(s1).char *strncat(char *s1, const char *s2,size_t n);
Enter details here
Which of the following function is used to find the first occurrence of a given string in another string?
Answer: C
No answer description available for this question.
Enter details here
What will be the output of the following C code?
#include
int main()
{
char *str = "hello, world";
char *str1 = "hello, world";
if (strcmp(str, str1))
printf("equal");
else
printf("unequal");
}
Answer: B
No answer description available for this question.
Enter details here
What will be the output of the program ?
#include
int main()
{
static char mess[6][30] = {"Don't walk in front of me...",
"I may not follow;",
"Don't walk behind me...",
"Just walk beside me...",
"And be my friend." };
printf("%c, %c\n", *(mess[2]+9), *(*(mess+2)+9));
return 0;
}
Answer: B
No answer description available for this question.
Enter details here
Which of the following function is more appropriate for reading in a multi-word string?
Answer: C
No answer description available for this question.
Enter details here
Which pre-defined function returns a pointer to the last occurence of a character in a string?
Answer: B
No answer description available for this question.
Enter details here
What will be the output of the following C code?
#include
int main()
{
char str[10] = "hello";
char *p = strrchr(str, 'l');
printf("%c\n", *(++p));
}
Answer: B
No answer description available for this question.
Enter details here
What is the function of void *memset(s, c, n)?
Answer: B
The void *memset(s, c, n) places character c into first n characters of s, return s.
Enter details here