Doubt in linked list

Is node* pre-defined datatype in c++.

If yes then it’s ok but if not then how we are using node* datatype without defining it ?

no it is not,
see we are defining a class called node, which will have some data and a pointer that will point to anothoer node of similar data type.

thats why we have written this
node * next ; // this indicates that next is a ponter that will point to a list Node whose data type is node.

1 Like

Ok now it’s clear :slightly_smiling_face:

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.