Which among the given options is the right explanation for the statement size_t strcspn(c, s)?
return length of prefix of s consisting of characters not in c
return length of prefix of s consisting of characters present in c
return length of prefix of c consisting of characters not in s
return length of prefix of c consisting of characters present in s
The mem functions are meant for _______
returning a pointer to the token
manipulating objects as character arrays
returning a pointer for implemented-defined string
returning a pointer to first occurrence of string in another string
Functions whose names begin with “strn”
manipulates sequences of arbitrary characters
manipulates null-terminated sequences of characters
manipulates sequence of non – null characters.
returns a pointer to the token
What is the function of strcoll()?
compares the string, result is dependent on the LC_COLLATE
copies the string, result is dependent on the LC_COLLATE
compares the string, result is not dependent on the LC_COLLATE
copies the string, result is not dependent on the LC_COLLATE
Which of the following is the variable type defined in header string. h?
sizet
size
size_t
size-t
NULL is the macro defined in the header string. h
True
False
What will be the output of the following C code?
const char str1[]="ABCDEF1234567"; const char str2[] = "269"; len = strcspn(str1, str2); printf("First matching character is at %d\n", len + 1);
First matching character is at 8
First matching character is at 7
First matching character is at 9
First matching character is at 12
Is there any function declared as strstr()?
True
False
The______function returns a pointer to the first character of a token.
strstr()
strcpy()
strspn()
strtok()
What will be the output of the following C code?
char str1[] = "Helloworld "; char str2[] = "Hello"; len = strspn(str1, str2); printf("Length of initial segment matching %d\n", len );
6
5
4
no match
This function offers the quickest way to determine whether two character sequences of the same known length match character for the character up to and including any null character in both.
strcmp()
memcmp()
strncmp()
no such function
What will be the output of the following C code?
char str1[15]; char str2[15]; int mat; strcpy(str1, "abcdef"); strcpy(str2, "ABCDEF"); mat= strncmp(str1, str2, 4); if(mat< 0) printf("str1 is not greater than str2"); else if(mat> 0) printf("str2 is is not greater than str1"); else printf("both are equal");