--:--









Quiz for Pointer to structures

Course: C Language | Subject: Unit 7 | Topic: Structures and Unions



Logo

Q1: What is a pointer to a structure?

Logo

Q2: How do you declare a pointer to a structure named "Student"?

Logo

Q3: Which operator is used to access members of a structure through a pointer?

Logo

Q4: If "struct Student s; struct Student *ptr = &s;", how to access the "age" member via ptr?

Logo

Q5: What is the difference between "ptr->member" and "(*ptr).member"?

Logo

Q6: Can a pointer to structure be assigned NULL?

Logo

Q7: How to allocate memory dynamically for a pointer to structure?

Logo

Q8: Which header file must be included to use malloc?

Logo

Q9: How do you free dynamically allocated memory for a structure pointer?

Logo

Q10: Can a pointer to structure be passed to a function?

Logo

Q11: What is the correct way to declare a function parameter as pointer to struct?

Logo

Q12: How to access members of a structure when passed as a pointer in function?

Logo

Q13: Can a pointer to structure be used to modify the structure's members?

Logo

Q14: Which statement correctly assigns a pointer to a structure variable?

Logo

Q15: What happens if you dereference a NULL pointer to structure?

Logo

Q16: Can pointer to structure be incremented like arrays?

Logo

Q17: What is the type of expression "ptr->age"?

Logo

Q18: How to print an integer member "age" of a structure through pointer?

Logo

Q19: Is "ptr->member" equivalent to "(*ptr).member"?

Are you ready to start test? Set your time limit