strrev
Reverses the character order in a string
#include <string.h>
char *strrev (
char *s1);
The address of the original string s1 is returned.
strrev replaces the string s1 with a string whose characters are in the reverse order.
#include <string.h> char source[ ] = {"A sample STRING"}; main () { printf ("%s\n", source); printf ("%s\n", strrev (source) ); printf ("%s\n", strrev (source) ); }
produces the following:
A sample STRING GNIRTS elpmas A A sample STRING