Programming |  C Programming |  strrev

Reverses all characters in s (except for the terminating null)

Declaration: *char *strrev(char *s);

 Remarks:
strrev changes all characters in a string to reverse order, except the terminating null character.

For example, it would change string\0 to gnirts\0

 Return Value:
strrev returns a pointer to the reversed string.

Example:

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

int main(void)
{
    char *forward = "string";

    printf("Before strrev(): %s\n", forward);
    strrev(forward);
    printf("After strrev():  %s\n", forward);
    return 0;
}

Defined in string.h

.

From http://www.cplusplus.com/ref/