Self Referential Structure

From WikiEducator
Jump to: navigation, search

Self Referential Structures :

Consider the following Structure definition :

struct  Term
{
 int coefficient ;
 int exponent ;
 Term *nextTerm ;
};

The above structure definition is a type of Self –Referential Structure , as we can see that their exist a data member * nextTerm which is a pointer variable. The important point to be noticed that it is a structure type pointer variable which will store the address of the Next term of a Polynomial.

We will see much use of these Self Referential Structure in our next Chapter on Data Structures.