c++ - How to get the address of node->next pointer -


i writing code on doubly linked list following function

struct node {     int data;     struct node *next;     struct node *prev; };  /* given node next_node, insert new node before given node */ void insertbefore(struct node** next_node, int new_data) 

i called insertbefore() main function:

 insertbefore(&head, 2);  // works fine 

but can't same fore head->next, because next pointer node* not node**

insertbefore(head->(&next), 2);  // doesn't works  

how can solve problem.please help.thanks

assuming function works, &(head->next) need.

insertbefore(&(head->next), 2);  

Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -