--:--









Quiz for Accessing structure members

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



Logo

Q1: Which operator is used to access a member of a structure variable?

Logo

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

Logo

Q3: Given "struct Point *p;", how do you access the x member?

Logo

Q4: What does the expression "ptr->member" mean?

Logo

Q5: Which is the correct way to access member "age" of a structure variable "s"?

Logo

Q6: How do you access structure members when you have a pointer to structure?

Logo

Q7: If "struct Student *ptr;" points to a structure, how to set the "marks" member to 90?

Logo

Q8: Which operator has higher precedence: "." or "->"?

Logo

Q9: Can the dot operator be used on a structure pointer?

Logo

Q10: What happens if you use dot operator directly on a pointer?

Logo

Q11: Given "struct Employee emp; struct Employee *ptr = &emp;", which is correct to access "salary"?

Logo

Q12: How do you access the first character of a string member "name" inside a structure "s"?

Logo

Q13: Can you use pointer arithmetic with structure pointers when accessing members?

Logo

Q14: If a structure member is a pointer, how do you access the data it points to?

Logo

Q15: Which is true about "(*ptr).member" and "ptr->member"?

Logo

Q16: How to access a member of an array of structures?

Logo

Q17: What will happen if you access a member of an uninitialized structure pointer?

Logo

Q18: Which header file is needed to use structures?

Logo

Q19: Which is correct to assign value 10 to member "count" in struct variable "data"?

Logo

Q20: Which is true about structure member access?

Are you ready to start test? Set your time limit