Self Referential Structure
- A self referential Structure is a structure which has a member which points to the same structure. This type of structure is called as self referential block
- When structure member can points to itself then this type of structure is called as Self Referential Structure
- Self Referential Structure are Used in data structures like Linked List ,Queues, doubly linked list, etc.
- Learning basic of self-referential structure now ,is very good thing, because you are learning basic for data structures
- let's see how you can make Self Referential Structure
We will define a structure Link which will have link number and pointer of structure Link data type as it's member.
defining:Structure Link
struct link
{
int link_no; //member1
struct link *links //member2
//*links is pointer of structure link data type
//which will point to structure link.
};
struct link { int link_no; //member1 struct link *links //member2 //*links is pointer of structure link data type //which will point to structure link. };
let's see structure link visually
- Pointer Links is pointer which is pointing to the structure link that is why it is making a another block of structure link
- It will make a block of structure link untill the pointer links will stop to point link structure.
- This is how Self Referential Structure works.
- This Self Referential Structure are used in data structure to make structures like linked list ,stack, etc.
- So ,try do more practice on Self Referential Structure for having good understanding in building structures like linked list ,stack, etc.
Further Concept:
People Also Searched:
- What are structures?
- Why structures?
- Need of Structure
- Concept of structure
- How to initialize an structure variable?
- How to Access Structure member?
- Functions and Structure
- How to pass a structure variable to function?
- How to make function which will take structure variable as arguments?
- How to make function which will return structure variable?
- Array and Structure
- How to make array of structure variable?
- How to initialize array structure variable?
- How to Access members of an array of structure?
- How to take members of array structure as input from the user?
- Pointer and Structure
- How to Point a structure variable?
- How to declare a pointer of structure variable?
- How to Initialize an pointer of structure variable?
- How to access member of structure variable which is point by an pointer?
- What is '->' Operator?
- How to allocate memory for structure variable Dynamically
- How to allocate memory of structure variable using malloc() and calloc() function
- Array and Pointer
- What is array of pointer?
- how to initialize an array of pointers?
- How to Access elements of an Array Of Pointers?
- Functions and Pointers
- How to pass a Pointer To a Function?
- Call By reference
- Functions In C
- Why Functions?
- What are Functions?
- how to write our functions?
- What are programmer define functions?
- How to declare function?
- How to define a function?
- What is function Prototype?
- how to declare a function?
- what are Actual Parameters?
- What are Formal Parameters?
- Function Call?
- how to call a Function?
- What are different types of calling function?
- Call by value
- call by reference
- Recursion
- Array and Functions
- How to pass an array to a function?
- What is Character array
- Functions for Characters
- Functions from #include<ctype.h> Header File
- what are isdigit(), islower() , isupper(),etc
- what are various string handling functions
- Functions from #include<string.h> Header File
- what are strcpy(), strcmp(), strncmp(), strcmpi(),etc
- strcmp() VS strncmp() VS strcmpi()
- Input And Output Functions
- How to take strings As Input
- What is gets() functions
- What is puts() function
0 Comments
Post a Comment