Listing 1

/* -------------------------------------------------------------

FUNCTION DISPLAY_NODE: The steps to display a selected node are:

A.  Complain if list empty.

B.  Get a string from the user.

C.  If no such node, complain else display its count and string.

------------------------------------------------------------- */

void display_node(void)
{
       Node *ploc_node;       /* ptr to located node */
       char string[21];       /* tmp holder for node's string */

/*A*/   if (proot_node == NULL) {
            printf("\n    List contains no nodes\n");
            return;
       }

/*B*/   printf("\n   Enter string: ");
       scanf("%20s", string);

/*C*/   ploc_node = locate_node(string, EXACT);
       if (ploc_node == NULL) {
              printf("No such node exists\n");
       }
       else {
              printf("\t%2u >%s<\n", ploc_node->count,
                     ploc_node->pstring);
       }
}

/* End of File */