Complete the code to access the member 'age' of the struct variable 'person'.
int age = person.[1];The dot operator (.) is used to access members of a struct variable. Here, 'age' is the correct member to access.
Complete the code to access the member 'salary' of the struct pointer 'empPtr'.
float sal = empPtr[1]salary;The arrow operator (->) is used to access members of a struct through a pointer.
Fix the error in accessing the 'id' member from the struct pointer 'studentPtr'.
int studentId = studentPtr[1]id;To access a member of a struct through a pointer, use the arrow operator (->).
Fill the blank to correctly access the 'grade' member of the struct pointer 'ptr'.
char grade = (*ptr)[1]grade;First, dereference the pointer with (*ptr), then use the dot operator (.) to access the member 'grade'.
Fill the blanks to create a pointer to struct 'Book' and access its 'title' member.
struct Book [1]bookPtr = &book;
char* title = bookPtr->title;Declare 'bookPtr' as a pointer to struct Book using '*'. Then use the arrow operator (->) to access members through the pointer.