class Node{
public:
int data;
Node *next;
//Constructor
Node int(d){
data=d;
next=NULL;
}
};
class Node{
public:
int data;
Node *next;
//Constructor
Node int(d){
data=d;
next=NULL;
}
};
Can’t I do it without a constructor?
If I will only write the below code, will it work?
class Node{
public:
int data;
Node *next;
};
Ok. Can you give an example
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.