Https://ide.codingblocks.com/s/420877

at line no 7 i have commented my doubt

in that case you can use this pointer
Ex
node(int data){

    this->data=data;

    next=NULL;

}

but why its giving garbage value

NO it is not giving garbage values
check the code
see output after running

plz remove line no 47 from this code
it’s added by mistake

i am asking that in my code if i am doing data=data why it is garbage value

node(int data) {

    data = data;

    next = NULL;

}

because inside constructor’s braces
only function’s parameter wala data is present
so the changes are not reflected back to class member wala data
hence class member wala data value remains garbage

complete doubly linklist is not printed

plz open a new thread for this

post a new doubt

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.