SOURCE FILE: writeBackward.cpp


void WriteBackward2(ptrType StringPtr)
// ---------------------------------------------------------
// Writes a string backward.
// Precondition: The string is represented as a linked list 
// to which the pointer StringPtr points.
// Postcondition: The string is displayed backward. The
// linked list and StringPtr are unchanged.
// ---------------------------------------------------------
{
   if (StringPtr != NULL)
   {  // write the string minus its first character backward
      WriteBackward2(StringPtr->Next);

      // write the first character
      cout << StringPtr->Item;
   }  // end if
}  // end WriteBackward2