strrev, _strrev, _fstrrev

reverse a string

Synopsis:

#include <string.h>
char *strrev( char *s1 );
char *_strrev( char *s1 );
char __far *_fstrrev( char __far *s1 );

Description:

The strrev() and _fstrrev() functions replace the string s1 with a string whose characters are in the reverse order.

The _strrev() function is identical to strrev(). Use _strrev() for ANSI naming conventions.

The _fstrrev() function is a data-model-independent form of the strrev() function. It accepts far pointer arguments, and returns a far pointer. It is most useful in mixed memory model applications.

Returns:

the address of the original string s1

Examples:

#include <stdio.h>
#include <string.h>

char source[] = { "A sample STRING" };

void main()
  {
    printf( "%s\n", source );
    printf( "%s\n", strrev( source ) );
    printf( "%s\n", strrev( source ) );
  }

produces the output:

A sample STRING
GNIRTS elpmas A
A sample STRING

Classification:

WATCOM

_strrev() conforms to ANSI naming conventions.

Systems:

strrev()
All (except DOS/PM)
_strrev()
All (except DOS/PM)
_fstrrev()
All (except Netware, DOS/PM)