Linked list insertion

Why we use node*next while defining pointer we use data type like int instead f using node which is defined inside the node class

Hello @Alfred as you have declared the class node in which you have two members the data and the pointer to the address of the next node.
so thats why it is of node type .
basically here we have defined the data type as node for according to our requierments.
Happy Learning!!

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.