Doubt regarding linkedlist

can someone guide me why am i getting address location rather than data in output

1 Like


Because it is printing the data as well as the address of the linked list but not the updated linked list.

You need to make one more class in which you can initialise the head and after that create the object of that class and try to print the details through the object.