--:--









Quiz for Pointers and strings

Course: C Language | Subject: Unit 6 | Topic: Pointers



Logo

Q1: Which operator is used to access the value pointed to by a pointer?

Logo

Q2: Which of the following correctly declares a pointer to a string in C?

Logo

Q3: If char *p = "Hello"; what does p point to?

Logo

Q4: Which function is used to get the length of a string?

Logo

Q5: What is the type of string literals in C?

Logo

Q6: Which statement copies one string into another?

Logo

Q7: If p is a pointer to a string, p+1 will point to?

Logo

Q8: Which library must be included for string functions?

Logo

Q9: What is the output of printf("%s", "Hello"+2);

Logo

Q10: How is a string stored in memory in C?

Logo

Q11: Which function compares two strings?

Logo

Q12: What is the output of char str[] = "C"; printf("%d", sizeof(str));

Logo

Q13: Which function concatenates two strings?

Logo

Q14: If char *s = "abc"; s[1] = "d"; what happens?

Logo

Q15: Which of the following is true about pointers to strings?

Logo

Q16: In C, char *s = "text"; sizeof(s) returns?

Logo

Q17: Which escape sequence represents a null character?

Logo

Q18: Which function is used to find a character in a string?

Logo

Q19: What will printf("%c", *("world"+3)); print?

Logo

Q20: If char s[] = "hi"; char *p = s; p[1] = "o"; result?

Are you ready to start test? Set your time limit