Write a C program to illustrate self-referential structures in c
Answers
Answered by
1
Answer:
You can define pointers to structures in the same way as you define pointer to any other variable −
struct Books *struct_pointer;
Now, you can store the address of a structure variable in the above defined pointer variable. To find the address of a structure variable, place the ‘&’; operator before the structure’s name as follows −
struct_pointer = &Book1;
To access the members of a structure using a pointer to that structure, you must use the → operator as follows −
struct_pointer->title;
Let us re-write the above example using structure pointer.
Similar questions
Math,
4 hours ago
Math,
4 hours ago
Chemistry,
4 hours ago
Business Studies,
7 hours ago
Math,
7 months ago
Computer Science,
7 months ago
Physics,
7 months ago