home *** CD-ROM | disk | FTP | other *** search
/ ftp.uv.es / 2014.11.ftp.uv.es.tar / ftp.uv.es / pub / unix / elm-2.4-pl20.tar.Z / elm-2.4-pl20.tar / lib / reverse.c < prev    next >
C/C++ Source or Header  |  1992-10-03  |  1KB  |  43 lines

  1. static char rcsid[] = "@(#)$Id: reverse.c,v 5.1 1992/10/03 22:41:36 syd Exp $";
  2.  
  3. /*******************************************************************************
  4.  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
  5.  *
  6.  *            Copyright (c) 1988-1992 USENET Community Trust
  7.  *            Copyright (c) 1986,1987 Dave Taylor
  8.  *******************************************************************************
  9.  * Bug reports, patches, comments, suggestions should be sent to:
  10.  *
  11.  *    Syd Weinstein, Elm Coordinator
  12.  *    elm@DSI.COM            dsinc!elm
  13.  *
  14.  *******************************************************************************
  15.  * $Log: reverse.c,v $
  16.  * Revision 5.1  1992/10/03  22:41:36  syd
  17.  * Initial checkin as of 2.4 Release at PL0
  18.  *
  19.  *
  20.  ******************************************************************************/
  21.  
  22. /** 
  23.  
  24. **/
  25.  
  26. #include "headers.h"
  27.  
  28.  
  29. reverse(string)
  30. char *string;
  31. {
  32.     /** reverse string... pretty trivial routine, actually! **/
  33.  
  34.     register char *head, *tail, c;
  35.  
  36.     for (head = string, tail = string + strlen(string) - 1; head < tail; head++, tail--)
  37.         {
  38.         c = *head;
  39.         *head = *tail;
  40.         *tail = c;
  41.         }
  42. }
  43.