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
Science,
17 days ago
History,
17 days ago
English,
17 days ago
Business Studies,
1 month ago
Math,
8 months ago
Computer Science,
8 months ago
Physics,
8 months ago