Friday 26 January 2018

self referential structures in c simple example program

Self-referential structures are those structures that contain a reference to data of its same type, i.e, in addition to other data, a self-referential structure contains a pointer to a data that is of the same type as that of the structure. For example, Consider the structure node given as follows.

Struct node;
{
Int val;
Struct node*next;
};

Here the structure node will contain two types of data-an integer val and next, which is a pointer to a node. Actually, self-referential structure is the foundation of other data structures.

The basic unit (or node) as specified in C is called a self-referential structure, one in which a member(s) is a pointer to a structure(s) of the same type.

0 comments :

Post a Comment

Note: only a member of this blog may post a comment.

Machine Learning

More

Advertisement

Java Tutorial

More

UGC NET CS TUTORIAL

MFCS
COA
PL-CG
DBMS
OPERATING SYSTEM
SOFTWARE ENG
DSA
TOC-CD
ARTIFICIAL INT

C Programming

More

Python Tutorial

More

Data Structures

More

computer Organization

More
Top