I want to insert at the beginning of the root of this function:
struct elem {
int value;
struct elem *next;
};
typedef struct elem Node;
void shiftInsert(Node *n, int v){
int tmp;
while (n != NULL){
n = n->next;
}
}
When the Node *n
is:
1 -> 2 -> 3 -> 4 -> 5
and call shiftInsert(88)
the output of Node *n
needs to be:
88->1 -> 2 -> 3 -> 4
how can I achieve this?