Following declaration
void insert_LL(Node *head, int data);
when called, a copy of head pointer reaches the function, so if a node is added at the head, the value of the head is changed. But, as we have the local copy of head so the actual head pointer isn't changed. So we declare it as follows
void insert_LL(Node **head, int data);
My question:
Is the above explanation correct?
If yes, so that means in C, it is always a pass by value (a copy of pointer is reached in the function) which is same as in Java. Am I correct?
If yes, so how does pass by reference/pointer come into the picture?