OP, if you want to work out how to write the code to complete the program, don't try to do it in your head, do it first on paper. It's not so easy to do in ASCII art but here is the method to insert into a linked list:
Code:
+-+       +-+
|A|--p1-->|C|
+-+       +-+

We want to insert B between A and C.  First step, point B at C:

+-+       +-+
|A|--p1-->|C|
+-+       +-+
           ^
+-+        |
|B|--p2----+
+-+

I've numbered the pointers so you can see what's going on.  Code for this
would be something like:
B->next=C;

Next step: point A at B instead of C:

+-+       +-+       +-+
|A|--p1-->|B|--p2-->|C|
+-+       +-+       +-+

Code: A->next=B;