ExplanationThe creation of a linked list is same as explained in the previous program. Here, an
element is inserted at the beginning. The function void atbeg () performs this task. In this function
two pointers *node (local to this function) and *t are declared. The malloc () function allocates
memory to pointer node. The entered element is placed in the newly created node. Consider the
following statements.
t=first;
header=node;
header - >next=t;
first=header;
The above four statements adjust the pointer links.
t=first: This statemen
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.