which of the following function returns a pointer to the located string or a null pointer if string is not found.
Answer: B
The strstr() function is used to return a pointer to the located string, or if string is not found a null pointer is returned.
Enter details here
What will be the output of the program ?
#include
int main()
{
printf(5+"Good Morning\n");
return 0;
}
Answer: D
No answer description available for this question.
Enter details here
What will be the output of the program ?
#include
#include
int main()
{
char str1[20] = "Hello", str2[20] = " World";
printf("%s\n", strcpy(str2, strcat(str1, str2)));
return 0;
}
Answer: C
No answer description available for this question.
Enter details here
Which of the following is the right syntax to copy n characters from the object pointed to by s2 into the object pointed to by s1?
Answer: A
The memcpy() function copies n characters from the object pointed to by s2 into the object pointed to by s1. If copying takes place between objects that overlap, the behavior is undefined.
Enter details here
The library function used to find the last occurrence of a character in a string is
Answer: C
No answer description available for this question.
Enter details here
What is the use of function char *strchr(ch, c)?
Answer: B
The given code char *strchr(ch, c) return pointer to first occurrence of c in ch or NULL if not present.
Enter details here
If the size of pointer is 32 bits What will be the output of the program ?
#include
int main()
{
char a[] = "Visual C++";
char *b = "Visual C++";
printf("%d, %d\n", sizeof(a), sizeof(b));
printf("%d, %d", sizeof(*a), sizeof(*b));
return 0;
}
Answer: C
No answer description available for this question.
Enter details here
What will the given C code do?
int memcmp(const void *str1, const void *str2, size_t n)
Answer: A
In the C library function int memcmp(const void *str1, const void *str2, size_t n)) is used to compare the first n bytes of memory area str1 and memory area str2.
Enter details here
Predict the output of the following program:
#include
int main()
{
char str[] = "%d %c", arr[] = "GeeksQuiz";
printf(str, 0[arr], 2[arr + 3]);
return 0;
}
Answer: C
No answer description available for this question.
Enter details here
There are two groups of string functions defined in the header
Answer: A
There are two groups of string functions declared under the header
Enter details here