I have created a linked list struct in c
struct node{ int value; struct node* next; };
a method to add a node at the start of the list :
I have learned @Vlad Lazarenko answer,and I made the code like this ,is it right?
addFirst((struct node**)head,123); void addFirst(struct node **list,int value) { struct node *new_node=malloc(sizeof(struct node)); new_node->value=value; new_node->next=*list; list=&new_node; }