Question: 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 :

```
void addFirst(struct node *list, int value){
    struct node *new_node = (struct node*) malloc (sizeof (struct node));
    new_node->value = value;
    new_node->next = list;
    list = new_node;
   }

```

I create a list (malloc and everything), then call this method, it adds the new node inside the method but when i get back to my main my old list remains unchanged. Using DDD debugger to check everything. How is this possible? I am not able to change the method signature so it has to be done like this.

Answer: 
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;
}

```
All is good, but in the `void addFirst(struct node *list, int value)` function the `list` is passed by value. Which means that a pointer is being copied and assignment of a new address to that pointer inside `addFirst` function is not visible to the caller of `addFirst`. To solve it, you have to either pass a pointer by pointer (`struct node **`) or make it a return value and require a caller to use it as a new "head".

And don't forget `;` after a struct declaration.