Definition of the each node:
struct Node
{
int x; // Information part.
struct Node *next; //Pointer to the next node
};
mnew is a pointer pointing to the newly allocated memory. malloc() has been used to allocate memory dynamically (i.e., during runtime of the program). Take the help of sizeof() operator to determine the size of a node because the variable size of the struct members depend on machine architecture and operating system used in that machine.
mnew=(struct Node *)malloc(sizeof(struct Node));
My socials:
[email protected]
https://psnacademy.in
/ psnayak
/ psnayakeducator
https://www.buymeacoffee.com/psnayak
/ psnayak2007
Note: This video is copyrighted, no part of it to be reproduced or republished.
Thumbnail background image by Gya Than Arts from Pixabay.