Exercise to create an insertString function to linked-list
I'm not sure if your insertEntry function is correct. It seems to be hardcoded to add an entry at the end of the linked list; you want to be able to add an entry anywhere (except at the start of the list which is the object of the next exercise in the book).

Here's my solution to this exercise.

/* Exercise 10.2

   Write a function called insertEntry() to insert a new entry into a linked
   list. Have the procedure take as arguments a pointer to the list entry to
   be inserted (of type struct entry as defined in this chapter), and a
   pointer to an element in the list *after* which the new entry is to be
   inserted.

   note: inserts n2_5 after n2
*/

#include &lt;stdio.h&gt;

struct entry
{
    int value;
    struct entry *next;
};

void insertEntry (struct entry *new, struct entry *follow)
{
    new-&gt;next = follow-&gt;next;
    follow-&gt;next = new;
}

int main (void)
{
    void insertEntry (struct entry *new, struct entry *follow);

    struct entry n1, n2, n3, n4, n5, n2_5, *listPtr;

    n1.value = 100;
    n1.next = &amp;n2;

    n2.value = 200;
    n2.next = &amp;n3;

    n3.value = 300;
    n3.next = &amp;n4;

    n4.value = 400;
    n4.next = &amp;n5;

    n5.value = 500;
    n5.next = (struct entry *) 0;

    printf ("\nlinked list: ");

    listPtr = &amp;n1;

    while ( listPtr != (struct entry *) 0 ) {
        printf ("%i ", listPtr-&gt;value);
        listPtr = listPtr-&gt;next;
    }

    printf ("\n");

    // insert new entry

    n2_5.value = 250;

    printf ("inserting new entry %i ...\n", n2_5.value);

    insertEntry (&amp;n2_5, &amp;n2);    

    printf ("linked list: ");

    listPtr = &amp;n1;

    while ( listPtr != (struct entry *) 0 ) {
        printf ("%i ", listPtr-&gt;value);
        listPtr = listPtr-&gt;next;
    }

    printf ("\n");

    return 0;
}