printf("\ name")gets(ptr->name)printf("\ course")gets(ptr->course)printf("\ fees")scanf("% "&ptr->fees)display(ptr)getch()return void display(struct student *ptrprintf("\ details of student")printf("\ roll no % "ptr->r_no)printf("\ name % "ptr->name)printf("\ course % "ptr->course)printf("\ fees % "ptr->fees)output enter the data for the student roll no namerahul coursebca fees details of student roll no name rahul course bca fees self-referential structures self-referential structures are those structures that contain reference to the data of its same type that isa self-referential structurein addition to other datacontains pointer to data that is of the same type as that of the structure for exampleconsider the structure node given below struct node int valstruct node *next}herethe structure node will contain two types of dataan integer val and pointer next you must be wondering why we need such structure actuallyself-referential structure is the foundation of other data structures we will be using them throughout this book and their purpose will be clearer to you when we discuss linked liststreesand graphs unions similar to structuresa union is collection of variables of different data types the only difference between structure and union is that in case of unionsyou can only store information in one field at any one time to better understand unionthink of it as chunk of memory that is used to store variables of different types when new value is assigned to fieldthe existing data is replaced with the new data thusunions are used to save memory they are useful for applications that involve multiple memberswhere values need not be assigned to all the members at any one time